Class: BusinessFlow::DSL::PublicField

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

Overview

Create a field with a public getter

Instance Method Summary collapse

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

#nameObject



421
422
423
# File 'lib/business_flow/dsl.rb', line 421

def name
  @field.name
end