Class: Spine::Transform::Mapping

Inherits:
Object
  • Object
show all
Includes:
Syntax::Boolean, Syntax::Copy, Syntax::Date, Syntax::Decimal, Syntax::Integer, Syntax::Timestamp, Syntax::Transform
Defined in:
lib/spine/transform/mapping.rb

Constant Summary

Constants included from Syntax::Boolean

Syntax::Boolean::FALSES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Syntax::Timestamp

#timestamp

Methods included from Syntax::Date

#date

Methods included from Syntax::Boolean

#boolean

Methods included from Syntax::Decimal

#decimal

Methods included from Syntax::Integer

#integer

Methods included from Syntax::Transform

#transform

Methods included from Syntax::Copy

#copy

Constructor Details

#initialize(dsl) ⇒ Mapping

Returns a new instance of Mapping.



14
15
16
# File 'lib/spine/transform/mapping.rb', line 14

def initialize(dsl)
  @dsl = dsl
end

Instance Attribute Details

#commandsObject (readonly)

Returns the value of attribute commands.



12
13
14
# File 'lib/spine/transform/mapping.rb', line 12

def commands
  @commands
end

Instance Method Details

#for(key) ⇒ Object



22
23
24
# File 'lib/spine/transform/mapping.rb', line 22

def for(key)
  commands[key] || Commands::Null
end

#parseObject



26
27
28
# File 'lib/spine/transform/mapping.rb', line 26

def parse
  instance_eval &@dsl
end