Class: BusinessFlow::DSL::FieldList
- Inherits:
-
Object
- Object
- BusinessFlow::DSL::FieldList
- 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
-
#field_list ⇒ Object
readonly
Returns the value of attribute field_list.
Instance Method Summary collapse
- #add_fields(fields) ⇒ Object
-
#initialize(field_list, field_klass, klasses) ⇒ FieldList
constructor
A new instance of FieldList.
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_list ⇒ Object (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 |