Class: Kitchen::Directions::BakeChapterGlossary::V1::Definition
- Defined in:
- lib/kitchen/directions/bake_chapter_glossary/v1.rb
Instance Attribute Summary collapse
-
#element ⇒ Object
readonly
Returns the value of attribute element.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(element) ⇒ Definition
constructor
A new instance of Definition.
Constructor Details
#initialize(element) ⇒ Definition
Returns a new instance of Definition.
8 9 10 11 12 13 |
# File 'lib/kitchen/directions/bake_chapter_glossary/v1.rb', line 8 def initialize(element) term = Kitchen::I18nString.new(element.first('dt').text.downcase) description = Kitchen::I18nString.new(element.first('dd').text.downcase) @sortable = [term, description] @element = element end |
Instance Attribute Details
#element ⇒ Object (readonly)
Returns the value of attribute element.
6 7 8 |
# File 'lib/kitchen/directions/bake_chapter_glossary/v1.rb', line 6 def element @element end |
Instance Method Details
#<=>(other) ⇒ Object
15 16 17 |
# File 'lib/kitchen/directions/bake_chapter_glossary/v1.rb', line 15 def <=>(other) sortable <=> other.sortable end |