Class: Section

Inherits:
Array
  • Object
show all
Defined in:
lib/yodel/models/core/record/section.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (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

Returns:

  • (Boolean)


10
11
12
# File 'lib/yodel/models/core/record/section.rb', line 10

def display?
  any? {|field| display_field?(field)}
end

#displayed_fieldsObject



14
15
16
# File 'lib/yodel/models/core/record/section.rb', line 14

def displayed_fields
  select {|field| display_field?(field)}
end