Class: XCRes::Section
- Inherits:
-
Object
- Object
- XCRes::Section
- Defined in:
- lib/xcres/model/section.rb
Instance Attribute Summary collapse
-
#items ⇒ Hash{String => String|Hash}
readonly
The items of the section.
-
#name ⇒ String
readonly
The name / key of the section.
-
#options ⇒ Hash
Options of the section for serialization.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
-
#initialize(name, items, options = {}) ⇒ Section
constructor
Initialize a new section.
Constructor Details
#initialize(name, items, options = {}) ⇒ Section
Initialize a new section
28 29 30 31 32 |
# File 'lib/xcres/model/section.rb', line 28 def initialize(name, items, ={}) @name = name @items = items @options = end |
Instance Attribute Details
#items ⇒ Hash{String => String|Hash} (readonly)
Returns the items of the section.
10 11 12 |
# File 'lib/xcres/model/section.rb', line 10 def items @items end |
#name ⇒ String (readonly)
Returns the name / key of the section.
6 7 8 |
# File 'lib/xcres/model/section.rb', line 6 def name @name end |
#options ⇒ Hash
Returns options of the section for serialization.
14 15 16 |
# File 'lib/xcres/model/section.rb', line 14 def @options end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
34 35 36 37 38 |
# File 'lib/xcres/model/section.rb', line 34 def ==(other) self.name == other.name \ && self.items == other.items \ && self. == other. end |