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
# File 'lib/oxidized/source/source.rb', line 5

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

Instance Method Details

#map_model(model) ⇒ Object



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

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

#node_var_interpolate(var) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/oxidized/source/source.rb', line 13

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