Class: Kitchen::Directions::BakeChapterGlossary::V1::Definition

Inherits:
Object
  • Object
show all
Defined in:
lib/kitchen/directions/bake_chapter_glossary/v1.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#elementObject (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