Class: Oxidized::Source

Inherits:
Object
  • Object
show all
Defined in:
lib/oxidized/source/source.rb

Direct Known Subclasses

CSV, HTTP, SQL

Defined Under Namespace

Classes: NoConfig

Instance Method Summary collapse

Constructor Details

#initializeSource

Returns a new instance of Source.



5
6
7
8
# File 'lib/oxidized/source/source.rb', line 5

def initialize
  @model_map = Oxidized.config.model_map || {}
  @group_map = Oxidized.config.group_map || {}
end

Instance Method Details

#map_group(group) ⇒ Object



14
15
16
# File 'lib/oxidized/source/source.rb', line 14

def map_group(group)
  @group_map.has_key?(group) ? @group_map[group] : group
end

#map_model(model) ⇒ Object



10
11
12
# File 'lib/oxidized/source/source.rb', line 10

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

#node_var_interpolate(var) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/oxidized/source/source.rb', line 18

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