Class: Eiwa::Tag::Reading
Instance Attribute Summary collapse
-
#frequency_tags ⇒ Object
readonly
Returns the value of attribute frequency_tags.
-
#info_tags ⇒ Object
readonly
Returns the value of attribute info_tags.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Attributes inherited from Any
#characters, #parent, #tag_name
Instance Method Summary collapse
- #end_child(child) ⇒ Object
- #imprecise_reading? ⇒ Boolean
-
#initialize ⇒ Reading
constructor
A new instance of Reading.
Methods inherited from Any
#add_characters, #end_self, #start, #to_s
Constructor Details
#initialize ⇒ Reading
Returns a new instance of Reading.
8 9 10 11 12 |
# File 'lib/eiwa/tag/reading.rb', line 8 def initialize @frequency_tags = [] @info_tags = [] @imprecise_reading = false end |
Instance Attribute Details
#frequency_tags ⇒ Object (readonly)
Returns the value of attribute frequency_tags.
6 7 8 |
# File 'lib/eiwa/tag/reading.rb', line 6 def @frequency_tags end |
#info_tags ⇒ Object (readonly)
Returns the value of attribute info_tags.
6 7 8 |
# File 'lib/eiwa/tag/reading.rb', line 6 def @info_tags end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
6 7 8 |
# File 'lib/eiwa/tag/reading.rb', line 6 def text @text end |
Instance Method Details
#end_child(child) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/eiwa/tag/reading.rb', line 18 def end_child(child) case child.tag_name when "reb" @text = child.characters when "re_pri" @frequency_tags << child.characters.to_sym when "re_inf" @info_tags << child when "re_nokanji" @imprecise_reading = true end end |
#imprecise_reading? ⇒ Boolean
14 15 16 |
# File 'lib/eiwa/tag/reading.rb', line 14 def imprecise_reading? @imprecise_reading end |