Class: Factbook::Sect
- Inherits:
-
Object
- Object
- Factbook::Sect
- Includes:
- LogUtils::Logging
- Defined in:
- lib/factbook-readers/sect.rb
Instance Attribute Summary collapse
-
#subsects ⇒ Object
Returns the value of attribute subsects.
-
#title ⇒ Object
use name instead of title - why? why not?.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize ⇒ Sect
constructor
A new instance of Sect.
Constructor Details
#initialize ⇒ Sect
Returns a new instance of Sect.
12 13 14 |
# File 'lib/factbook-readers/sect.rb', line 12 def initialize @subsects = [] end |
Instance Attribute Details
#subsects ⇒ Object
Returns the value of attribute subsects.
10 11 12 |
# File 'lib/factbook-readers/sect.rb', line 10 def subsects @subsects end |
#title ⇒ Object
use name instead of title - why? why not?
9 10 11 |
# File 'lib/factbook-readers/sect.rb', line 9 def title @title end |
Instance Method Details
#data ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/factbook-readers/sect.rb', line 16 def data ## convert sects to hash @data = {} subsects.each_with_index do |subsect,i| @data[ subsect.title ] = subsect.data end @data end |