Class: Lutaml::Rdf::Iri
- Inherits:
-
Object
- Object
- Lutaml::Rdf::Iri
- Includes:
- Comparable
- Defined in:
- lib/lutaml/rdf/iri.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #==(other) ⇒ Object (also: #eql?)
- #compact(namespace_set) ⇒ Object
- #expand(namespace_set) ⇒ Object
- #hash ⇒ Object
-
#initialize(uri_string) ⇒ Iri
constructor
A new instance of Iri.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(uri_string) ⇒ Iri
Returns a new instance of Iri.
10 11 12 |
# File 'lib/lutaml/rdf/iri.rb', line 10 def initialize(uri_string) @value = uri_string.to_s.freeze end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
8 9 10 |
# File 'lib/lutaml/rdf/iri.rb', line 8 def value @value end |
Instance Method Details
#<=>(other) ⇒ Object
22 23 24 |
# File 'lib/lutaml/rdf/iri.rb', line 22 def <=>(other) other.is_a?(self.class) ? value <=> other.value : nil end |
#==(other) ⇒ Object Also known as: eql?
26 27 28 |
# File 'lib/lutaml/rdf/iri.rb', line 26 def ==(other) other.is_a?(self.class) && value == other.value end |
#compact(namespace_set) ⇒ Object
18 19 20 |
# File 'lib/lutaml/rdf/iri.rb', line 18 def compact(namespace_set) namespace_set.compact(value) end |
#expand(namespace_set) ⇒ Object
14 15 16 |
# File 'lib/lutaml/rdf/iri.rb', line 14 def (namespace_set) namespace_set.resolve_compact_iri(value) end |
#hash ⇒ Object
31 32 33 |
# File 'lib/lutaml/rdf/iri.rb', line 31 def hash value.hash end |
#inspect ⇒ Object
39 40 41 |
# File 'lib/lutaml/rdf/iri.rb', line 39 def inspect "#<#{self.class.name} #{value}>" end |
#to_s ⇒ Object
35 36 37 |
# File 'lib/lutaml/rdf/iri.rb', line 35 def to_s value end |