summaryrefslogtreecommitdiff
path: root/lib/oxidized/source/source.rb
blob: 3bae0f608cb0346fe571b5a1b668aac36d1a7256 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
module Oxidized
  class Source
    class NoConfig < OxidizedError; end

    def initialize
      @map = (Oxidized.config.model_map or {})
    end

    def map_model model
      @map.has_key?(model) ? @map[model] : model
    end

    def node_var_interpolate var
      case var
      when "nil"   then nil
      when "false" then false
      when "true"  then true
      else var
      end
    end
  end
end