Class: BusinessFlow::DSL::ParameterField
- Inherits:
-
Object
- Object
- BusinessFlow::DSL::ParameterField
- Defined in:
- lib/business_flow/dsl.rb
Overview
Helper class around input parameter fields
Instance Method Summary collapse
- #add_to(klass) ⇒ Object
-
#initialize(field, fallback = nil) ⇒ ParameterField
constructor
A new instance of ParameterField.
- #name ⇒ Object
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 |
#name ⇒ Object
509 510 511 |
# File 'lib/business_flow/dsl.rb', line 509 def name @field.name end |