Class: BusinessFlow::DSL::ParameterField

Inherits:
Object
  • Object
show all
Defined in:
lib/business_flow/dsl.rb

Overview

Helper class around input parameter fields

Instance Method Summary collapse

Constructor Details

#initialize(field, fallback = nil) ⇒ ParameterField

Returns a new instance of ParameterField.



498
499
500
501
502
# File 'lib/business_flow/dsl.rb', line 498

def initialize(field, fallback = nil)
  retriever = "_business_flow_parameter_fetch(:#{field})"
  retriever += " { send(:#{fallback}) }" if fallback
  @field = MemoizedField.new(field, retriever, method(:setter_factory))
end

Instance Method Details

#add_to(klass) ⇒ Object



504
505
506
507
# File 'lib/business_flow/dsl.rb', line 504

def add_to(klass)
  @field.add_to(klass)
  klass.send(:public, @field.field)
end

#nameObject



509
510
511
# File 'lib/business_flow/dsl.rb', line 509

def name
  @field.name
end