Class: NTimeLine::Category
- Inherits:
-
Object
- Object
- NTimeLine::Category
- Defined in:
- lib/ntimeline/category.rb
Overview
Category of timeline.
Instance Attribute Summary collapse
-
#display_name ⇒ Object
readonly
Returns the value of attribute display_name.
-
#sub_categories ⇒ Object
readonly
Returns the value of attribute sub_categories.
Instance Method Summary collapse
-
#initialize(elt) ⇒ Category
constructor
A new instance of Category.
Constructor Details
#initialize(elt) ⇒ Category
Returns a new instance of Category.
7 8 9 10 11 12 13 |
# File 'lib/ntimeline/category.rb', line 7 def initialize(elt) @display_name = elt.elements["dispaly_name"].to_s @sub_categories = [] elt.each_element("sub_categories/category") do |category| @sub_categories << Category.new(category) end end |
Instance Attribute Details
#display_name ⇒ Object (readonly)
Returns the value of attribute display_name.
5 6 7 |
# File 'lib/ntimeline/category.rb', line 5 def display_name @display_name end |
#sub_categories ⇒ Object (readonly)
Returns the value of attribute sub_categories.
5 6 7 |
# File 'lib/ntimeline/category.rb', line 5 def sub_categories @sub_categories end |