Class: RdfaParser::Literal::Language

Inherits:
Object
  • Object
show all
Defined in:
lib/rdfa_parser/literal.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#valueObject

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_sObject



316
# File 'lib/rdfa_parser/literal.rb', line 316

def to_s; @value; end