Class: BusinessFlow::DSL::PublicField
- Inherits:
-
Object
- Object
- BusinessFlow::DSL::PublicField
- Defined in:
- lib/business_flow/dsl.rb
Overview
Create a field with a public getter
Instance Method Summary collapse
- #add_to(klass) ⇒ Object
-
#initialize(field) ⇒ PublicField
constructor
A new instance of PublicField.
- #name ⇒ Object
Constructor Details
#initialize(field) ⇒ PublicField
Returns a new instance of PublicField.
411 412 413 414 |
# File 'lib/business_flow/dsl.rb', line 411 def initialize(field) @name = field @field = Field.new(field) end |
Instance Method Details
#add_to(klass) ⇒ Object
416 417 418 419 |
# File 'lib/business_flow/dsl.rb', line 416 def add_to(klass) @field.add_to(klass) klass.send(:public, @name) end |
#name ⇒ Object
421 422 423 |
# File 'lib/business_flow/dsl.rb', line 421 def name @field.name end |