Class: Opml::Outline
- Inherits:
-
Object
- Object
- Opml::Outline
- Defined in:
- lib/opml.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#outlines ⇒ Object
Returns the value of attribute outlines.
Instance Method Summary collapse
- #flatten ⇒ Object
-
#initialize(element) ⇒ Outline
constructor
A new instance of Outline.
- #method_missing(method, *args, &block) ⇒ Object
- #respond_to?(method) ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
36 37 38 |
# File 'lib/opml.rb', line 36 def method_missing(method, *args, &block) attributes[method.to_s] || super end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
16 17 18 |
# File 'lib/opml.rb', line 16 def attributes @attributes end |
#outlines ⇒ Object
Returns the value of attribute outlines.
16 17 18 |
# File 'lib/opml.rb', line 16 def outlines @outlines end |
Instance Method Details
#flatten ⇒ Object
23 24 25 |
# File 'lib/opml.rb', line 23 def flatten @flatten ||= @outlines.map(&:flatten).unshift(self) end |
#respond_to?(method) ⇒ Boolean
31 32 33 34 |
# File 'lib/opml.rb', line 31 def respond_to?(method) return true if attributes[method.to_s] super end |
#to_s ⇒ Object
27 28 29 |
# File 'lib/opml.rb', line 27 def to_s @to_s ||= attributes['text'] || super end |