Class: Eiwa::Tag::Meaning
Instance Attribute Summary collapse
-
#antonyms ⇒ Object
readonly
Returns the value of attribute antonyms.
-
#comments ⇒ Object
readonly
Returns the value of attribute comments.
-
#cross_references ⇒ Object
readonly
Returns the value of attribute cross_references.
-
#definitions ⇒ Object
readonly
Returns the value of attribute definitions.
-
#dialects ⇒ Object
readonly
Returns the value of attribute dialects.
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#misc_tags ⇒ Object
readonly
Returns the value of attribute misc_tags.
-
#parts_of_speech ⇒ Object
readonly
Returns the value of attribute parts_of_speech.
-
#restricted_to_readings ⇒ Object
readonly
Returns the value of attribute restricted_to_readings.
-
#restricted_to_spellings ⇒ Object
readonly
Returns the value of attribute restricted_to_spellings.
-
#source_languages ⇒ Object
readonly
Returns the value of attribute source_languages.
Attributes inherited from Any
#characters, #parent, #tag_name
Instance Method Summary collapse
- #end_child(child) ⇒ Object
-
#initialize ⇒ Meaning
constructor
A new instance of Meaning.
- #trickle_down(previous) ⇒ Object
Methods inherited from Any
#add_characters, #end_self, #start, #to_s
Constructor Details
#initialize ⇒ Meaning
Returns a new instance of Meaning.
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/eiwa/tag/meaning.rb', line 10 def initialize @parts_of_speech = [] @definitions = [] @misc_tags = [] @cross_references = [] @restricted_to_readings = [] @restricted_to_spellings = [] @antonyms = [] @fields = [] @source_languages = [] @dialects = [] @comments = [] end |
Instance Attribute Details
#antonyms ⇒ Object (readonly)
Returns the value of attribute antonyms.
6 7 8 |
# File 'lib/eiwa/tag/meaning.rb', line 6 def antonyms @antonyms end |
#comments ⇒ Object (readonly)
Returns the value of attribute comments.
6 7 8 |
# File 'lib/eiwa/tag/meaning.rb', line 6 def comments @comments end |
#cross_references ⇒ Object (readonly)
Returns the value of attribute cross_references.
6 7 8 |
# File 'lib/eiwa/tag/meaning.rb', line 6 def cross_references @cross_references end |
#definitions ⇒ Object (readonly)
Returns the value of attribute definitions.
6 7 8 |
# File 'lib/eiwa/tag/meaning.rb', line 6 def definitions @definitions end |
#dialects ⇒ Object (readonly)
Returns the value of attribute dialects.
6 7 8 |
# File 'lib/eiwa/tag/meaning.rb', line 6 def dialects @dialects end |
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
6 7 8 |
# File 'lib/eiwa/tag/meaning.rb', line 6 def fields @fields end |
#misc_tags ⇒ Object (readonly)
Returns the value of attribute misc_tags.
6 7 8 |
# File 'lib/eiwa/tag/meaning.rb', line 6 def @misc_tags end |
#parts_of_speech ⇒ Object (readonly)
Returns the value of attribute parts_of_speech.
6 7 8 |
# File 'lib/eiwa/tag/meaning.rb', line 6 def parts_of_speech @parts_of_speech end |
#restricted_to_readings ⇒ Object (readonly)
Returns the value of attribute restricted_to_readings.
6 7 8 |
# File 'lib/eiwa/tag/meaning.rb', line 6 def restricted_to_readings @restricted_to_readings end |
#restricted_to_spellings ⇒ Object (readonly)
Returns the value of attribute restricted_to_spellings.
6 7 8 |
# File 'lib/eiwa/tag/meaning.rb', line 6 def restricted_to_spellings @restricted_to_spellings end |
#source_languages ⇒ Object (readonly)
Returns the value of attribute source_languages.
6 7 8 |
# File 'lib/eiwa/tag/meaning.rb', line 6 def source_languages @source_languages end |
Instance Method Details
#end_child(child) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/eiwa/tag/meaning.rb', line 24 def end_child(child) case child.tag_name when "pos" @parts_of_speech << child when "gloss" @definitions << child when "misc" @misc_tags << child when "field" @fields << child when "xref" @cross_references << child when "ant" @antonyms << child when "stagr" @restricted_to_readings << child.characters when "stagk" @restricted_to_spellings << child.characters when "lsource" @source_languages << child when "dial" @dialects << child when "s_inf" @comments << child.characters end end |
#trickle_down(previous) ⇒ Object
51 52 53 54 |
# File 'lib/eiwa/tag/meaning.rb', line 51 def trickle_down(previous) @parts_of_speech = previous.parts_of_speech if @parts_of_speech.empty? @misc_tags = previous. if @misc_tags.empty? end |