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.
51 52 53 54 55 56 |
# File 'lib/active_rdf/objectmanager/literal.rb', line 51 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.
50 51 52 |
# File 'lib/active_rdf/objectmanager/literal.rb', line 50 def lang @lang end |
Instance Method Details
#to_ntriple ⇒ Object
58 59 60 61 62 63 64 |
# File 'lib/active_rdf/objectmanager/literal.rb', line 58 def to_ntriple if @lang "\"#{to_s}\"@#@lang" else super end end |