Class: RdfaParser::Literal::Language
- Inherits:
-
Object
- Object
- RdfaParser::Literal::Language
- Defined in:
- lib/rdfa_parser/literal.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #clean(string) ⇒ Object
-
#initialize(string) ⇒ Language
constructor
A new instance of Language.
- #to_s ⇒ Object
Constructor Details
#initialize(string) ⇒ Language
Returns a new instance of Language.
296 297 298 |
# File 'lib/rdfa_parser/literal.rb', line 296 def initialize(string) @value = string.to_s.downcase end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
295 296 297 |
# File 'lib/rdfa_parser/literal.rb', line 295 def value @value end |
Instance Method Details
#==(other) ⇒ Object
307 308 309 310 311 312 313 314 |
# File 'lib/rdfa_parser/literal.rb', line 307 def == (other) case other when String other == @value when self.class other.value == @value end end |
#clean(string) ⇒ Object
300 301 302 303 304 305 |
# File 'lib/rdfa_parser/literal.rb', line 300 def clean(string) case string when "eng"; "en" else string end end |
#to_s ⇒ Object
316 |
# File 'lib/rdfa_parser/literal.rb', line 316 def to_s; @value; end |