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
Returns a new instance of Entry.
6 7 8 9 10 |
# File 'lib/eiwa/tag/entry.rb', line 6 def initialize @spellings = [] @readings = [] @meanings = [] end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/eiwa/tag/entry.rb', line 4 def id @id end |
#meanings ⇒ Object (readonly)
Returns the value of attribute meanings.
4 5 6 |
# File 'lib/eiwa/tag/entry.rb', line 4 def meanings @meanings end |
#readings ⇒ Object (readonly)
Returns the value of attribute readings.
4 5 6 |
# File 'lib/eiwa/tag/entry.rb', line 4 def readings @readings end |
#spellings ⇒ Object (readonly)
Returns the value of attribute spellings.
4 5 6 |
# File 'lib/eiwa/tag/entry.rb', line 4 def spellings @spellings end |
Instance Method Details
#end_child(child) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/eiwa/tag/entry.rb', line 16 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
12 13 14 |
# File 'lib/eiwa/tag/entry.rb', line 12 def text (@spellings + @readings).first.text end |