Class: Eiwa::Tag::Spelling

Inherits:
Any
  • Object
show all
Defined in:
lib/eiwa/tag/spelling.rb

Instance Attribute Summary collapse

Attributes inherited from Any

#characters, #parent, #tag_name

Instance Method Summary collapse

Methods inherited from Any

#add_characters, #end_self, #start, #to_s

Constructor Details

#initializeSpelling

Returns a new instance of Spelling.



8
9
10
11
# File 'lib/eiwa/tag/spelling.rb', line 8

def initialize
  @frequency_tags = []
  @info_tags = []
end

Instance Attribute Details

#frequency_tagsObject (readonly)

Returns the value of attribute frequency_tags.



6
7
8
# File 'lib/eiwa/tag/spelling.rb', line 6

def frequency_tags
  @frequency_tags
end

#info_tagsObject (readonly)

Returns the value of attribute info_tags.



6
7
8
# File 'lib/eiwa/tag/spelling.rb', line 6

def info_tags
  @info_tags
end

#textObject (readonly)

Returns the value of attribute text.



6
7
8
# File 'lib/eiwa/tag/spelling.rb', line 6

def text
  @text
end

Instance Method Details

#end_child(child) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'lib/eiwa/tag/spelling.rb', line 13

def end_child(child)
  case child.tag_name
  when "keb"
    @text = child.characters
  when "ke_pri"
    @frequency_tags << child.characters.to_sym
  when "ke_inf"
    @info_tags << child
  end
end