Class: BusinessFlow::DSL::FieldList

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

Overview

Responsible for creating fields on one or more classes and noting the of field

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(field_list, field_klass, klasses) ⇒ FieldList

Returns a new instance of FieldList.



224
225
226
227
228
229
# File 'lib/business_flow/dsl.rb', line 224

def initialize(field_list, field_klass, klasses)
  @field_list = []
  @field_klass = field_klass
  @klasses = [klasses].flatten
  add_fields(field_list)
end

Instance Attribute Details

#field_listObject (readonly)

Returns the value of attribute field_list.



222
223
224
# File 'lib/business_flow/dsl.rb', line 222

def field_list
  @field_list
end

Instance Method Details

#add_fields(fields) ⇒ Object



231
232
233
234
235
236
# File 'lib/business_flow/dsl.rb', line 231

def add_fields(fields)
  fields.each do |field|
    add_field(@field_klass.new(field))
  end
  @field_list.concat(fields)
end