Class: KDL::Types::IRLReference
- Defined in:
- lib/kdl/types/irl.rb,
lib/kdl/types/irl/parser.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Parser
Constant Summary
Constants inherited from Value
Instance Attribute Summary collapse
-
#unicode_domain ⇒ Object
readonly
Returns the value of attribute unicode_domain.
-
#unicode_hash ⇒ Object
readonly
Returns the value of attribute unicode_hash.
-
#unicode_path ⇒ Object
readonly
Returns the value of attribute unicode_path.
-
#unicode_search ⇒ Object
readonly
Returns the value of attribute unicode_search.
-
#unicode_value ⇒ Object
readonly
Returns the value of attribute unicode_value.
Attributes inherited from Value
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(value, unicode_value:, unicode_domain:, unicode_path:, unicode_search:, unicode_hash:, **kwargs) ⇒ IRLReference
constructor
A new instance of IRLReference.
Methods inherited from Value
#as_type, from, #stringify_value, #to_s
Constructor Details
#initialize(value, unicode_value:, unicode_domain:, unicode_path:, unicode_search:, unicode_hash:, **kwargs) ⇒ IRLReference
Returns a new instance of IRLReference.
12 13 14 15 16 17 18 19 |
# File 'lib/kdl/types/irl.rb', line 12 def initialize(value, unicode_value:, unicode_domain:, unicode_path:, unicode_search:, unicode_hash:, **kwargs) super(value, **kwargs) @unicode_value = unicode_value @unicode_domain = unicode_domain @unicode_path = unicode_path @unicode_search = unicode_search @unicode_hash = unicode_hash end |
Instance Attribute Details
#unicode_domain ⇒ Object (readonly)
Returns the value of attribute unicode_domain.
6 7 8 |
# File 'lib/kdl/types/irl.rb', line 6 def unicode_domain @unicode_domain end |
#unicode_hash ⇒ Object (readonly)
Returns the value of attribute unicode_hash.
6 7 8 |
# File 'lib/kdl/types/irl.rb', line 6 def unicode_hash @unicode_hash end |
#unicode_path ⇒ Object (readonly)
Returns the value of attribute unicode_path.
6 7 8 |
# File 'lib/kdl/types/irl.rb', line 6 def unicode_path @unicode_path end |
#unicode_search ⇒ Object (readonly)
Returns the value of attribute unicode_search.
6 7 8 |
# File 'lib/kdl/types/irl.rb', line 6 def unicode_search @unicode_search end |
#unicode_value ⇒ Object (readonly)
Returns the value of attribute unicode_value.
6 7 8 |
# File 'lib/kdl/types/irl.rb', line 6 def unicode_value @unicode_value end |
Class Method Details
.call(value, type = 'irl-reference') ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/kdl/types/irl.rb', line 21 def self.call(value, type = 'irl-reference') return nil unless value.is_a? ::KDL::Value::String ascii_value, params = parser(value.value).parse new(URI.parse(ascii_value), type: type, **params) end |
.parser(string) ⇒ Object
29 30 31 |
# File 'lib/kdl/types/irl.rb', line 29 def self.parser(string) IRLReference::Parser.new(string) end |