Class: StackMaster::SparkleFormation::CompileTime::StateBuilder
- Inherits:
-
Object
- Object
- StackMaster::SparkleFormation::CompileTime::StateBuilder
- Defined in:
- lib/stack_master/sparkle_formation/compile_time/state_builder.rb
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(definitions, parameters) ⇒ StateBuilder
constructor
A new instance of StateBuilder.
Constructor Details
#initialize(definitions, parameters) ⇒ StateBuilder
Returns a new instance of StateBuilder.
8 9 10 11 |
# File 'lib/stack_master/sparkle_formation/compile_time/state_builder.rb', line 8 def initialize(definitions, parameters) @definitions = definitions @parameters = parameters end |
Instance Method Details
#build ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/stack_master/sparkle_formation/compile_time/state_builder.rb', line 13 def build state = {} @definitions.each do |name, definition| parameter_key = name.to_s.camelize parameter = @parameters[parameter_key] state[name] = create_value(definition, parameter) end state end |