Class: Eiwa::Tag::SourceLanguage
- Defined in:
- lib/eiwa/tag/source_language.rb
Instance Attribute Summary collapse
-
#language ⇒ Object
readonly
Returns the value of attribute language.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#wasei ⇒ Object
readonly
Returns the value of attribute wasei.
Attributes inherited from Any
#characters, #parent, #tag_name
Instance Method Summary collapse
- #end_self ⇒ Object
- #eql?(other) ⇒ Boolean (also: #==)
- #hash ⇒ Object
-
#initialize(text: nil, language: "eng", wasei: false, type: "full") ⇒ SourceLanguage
constructor
A new instance of SourceLanguage.
Methods inherited from Any
#add_characters, #end_child, #start, #to_s
Constructor Details
#initialize(text: nil, language: "eng", wasei: false, type: "full") ⇒ SourceLanguage
Returns a new instance of SourceLanguage.
6 7 8 9 10 11 |
# File 'lib/eiwa/tag/source_language.rb', line 6 def initialize(text: nil, language: "eng", wasei: false, type: "full") @text = text @language = language @wasei = wasei @type = type end |
Instance Attribute Details
#language ⇒ Object (readonly)
Returns the value of attribute language.
4 5 6 |
# File 'lib/eiwa/tag/source_language.rb', line 4 def language @language end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
4 5 6 |
# File 'lib/eiwa/tag/source_language.rb', line 4 def text @text end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
4 5 6 |
# File 'lib/eiwa/tag/source_language.rb', line 4 def type @type end |
#wasei ⇒ Object (readonly)
Returns the value of attribute wasei.
4 5 6 |
# File 'lib/eiwa/tag/source_language.rb', line 4 def wasei @wasei end |
Instance Method Details
#end_self ⇒ Object
13 14 15 16 17 18 |
# File 'lib/eiwa/tag/source_language.rb', line 13 def end_self @text = @characters @language = @attrs["xml:lang"] @wasei = @attrs["ls_wasei"] == "y" @type = @attrs["ls_type"] || "full" end |
#eql?(other) ⇒ Boolean Also known as: ==
20 21 22 23 24 25 |
# File 'lib/eiwa/tag/source_language.rb', line 20 def eql?(other) @text == other.text && @language == other.language && @wasei == other.wasei && @type == other.type end |
#hash ⇒ Object
28 29 30 |
# File 'lib/eiwa/tag/source_language.rb', line 28 def hash [@text, @language, @wasei, @type].hash end |