Class: Eiwa::Tag::Entry
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#meanings ⇒ Object
readonly
Returns the value of attribute meanings.
-
#readings ⇒ Object
readonly
Returns the value of attribute readings.
-
#spellings ⇒ Object
readonly
Returns the value of attribute spellings.
Attributes inherited from Any
#characters, #parent, #tag_name
Instance Method Summary collapse
- #end_child(child) ⇒ Object
-
#initialize ⇒ Entry
constructor
A new instance of Entry.
- #text ⇒ Object
Methods inherited from Any
#add_characters, #end_self, #start, #to_s
Constructor Details
#initialize ⇒ Entry
8 9 10 11 12 |
# File 'lib/eiwa/tag/entry.rb', line 8 def initialize @spellings = [] @readings = [] @meanings = [] end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/eiwa/tag/entry.rb', line 6 def id @id end |
#meanings ⇒ Object (readonly)
Returns the value of attribute meanings.
6 7 8 |
# File 'lib/eiwa/tag/entry.rb', line 6 def meanings @meanings end |
#readings ⇒ Object (readonly)
Returns the value of attribute readings.
6 7 8 |
# File 'lib/eiwa/tag/entry.rb', line 6 def readings @readings end |
#spellings ⇒ Object (readonly)
Returns the value of attribute spellings.
6 7 8 |
# File 'lib/eiwa/tag/entry.rb', line 6 def spellings @spellings end |
Instance Method Details
#end_child(child) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/eiwa/tag/entry.rb', line 18 def end_child(child) case child.tag_name when "ent_seq" @id = child.characters.to_i when "k_ele" @spellings << child when "r_ele" @readings << child when "sense" child.trickle_down(@meanings.last) unless @meanings.last.nil? @meanings << child end end |
#text ⇒ Object
14 15 16 |
# File 'lib/eiwa/tag/entry.rb', line 14 def text (@spellings + @readings).first.text end |