Class: LocalizedString
- Includes:
- Literal
- Defined in:
- lib/active_rdf/objectmanager/literal.rb
Instance Attribute Summary collapse
-
#lang ⇒ Object
readonly
Returns the value of attribute lang.
Instance Method Summary collapse
-
#initialize(value, lang = nil) ⇒ LocalizedString
constructor
A new instance of LocalizedString.
- #to_ntriple ⇒ Object
Methods included from Literal
Constructor Details
#initialize(value, lang = nil) ⇒ LocalizedString
Returns a new instance of LocalizedString.
57 58 59 60 61 62 |
# File 'lib/active_rdf/objectmanager/literal.rb', line 57 def initialize value, lang=nil super(value) @lang = lang @lang = lang[1..-1] if @lang[0..0] == '@' end |
Instance Attribute Details
#lang ⇒ Object (readonly)
Returns the value of attribute lang.
56 57 58 |
# File 'lib/active_rdf/objectmanager/literal.rb', line 56 def lang @lang end |
Instance Method Details
#to_ntriple ⇒ Object
64 65 66 67 68 69 70 |
# File 'lib/active_rdf/objectmanager/literal.rb', line 64 def to_ntriple if @lang "\"#{to_s}\"@#@lang" else super end end |