Class: Section
- Inherits:
-
Array
- Object
- Array
- Section
- Defined in:
- lib/yodel/models/core/record/section.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #display? ⇒ Boolean
- #displayed_fields ⇒ Object
-
#initialize(name, initial_fields = []) ⇒ Section
constructor
A new instance of Section.
Constructor Details
#initialize(name, initial_fields = []) ⇒ Section
Returns a new instance of Section.
4 5 6 7 8 |
# File 'lib/yodel/models/core/record/section.rb', line 4 def initialize(name, initial_fields=[]) super() @name = name push(*initial_fields) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
2 3 4 |
# File 'lib/yodel/models/core/record/section.rb', line 2 def name @name end |
Instance Method Details
#display? ⇒ Boolean
10 11 12 |
# File 'lib/yodel/models/core/record/section.rb', line 10 def display? any? {|field| display_field?(field)} end |
#displayed_fields ⇒ Object
14 15 16 |
# File 'lib/yodel/models/core/record/section.rb', line 14 def displayed_fields select {|field| display_field?(field)} end |