Class: KDL::Types::IRLReference
- Inherits:
-
Value::Custom
- Object
- Value
- Value::Custom
- 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::Custom
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::Custom
Methods inherited from Value
#==, #as_type, from, #inspect, #method_missing, #respond_to_missing?, #stringify_value, #to_s, #to_v2, #version
Constructor Details
#initialize(value, unicode_value:, unicode_domain:, unicode_path:, unicode_search:, unicode_hash:, **kwargs) ⇒ IRLReference
Returns a new instance of IRLReference.
14 15 16 17 18 19 20 21 |
# File 'lib/kdl/types/irl.rb', line 14 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 |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class KDL::Value
Instance Attribute Details
#unicode_domain ⇒ Object (readonly)
Returns the value of attribute unicode_domain.
8 9 10 |
# File 'lib/kdl/types/irl.rb', line 8 def unicode_domain @unicode_domain end |
#unicode_hash ⇒ Object (readonly)
Returns the value of attribute unicode_hash.
8 9 10 |
# File 'lib/kdl/types/irl.rb', line 8 def unicode_hash @unicode_hash end |
#unicode_path ⇒ Object (readonly)
Returns the value of attribute unicode_path.
8 9 10 |
# File 'lib/kdl/types/irl.rb', line 8 def unicode_path @unicode_path end |
#unicode_search ⇒ Object (readonly)
Returns the value of attribute unicode_search.
8 9 10 |
# File 'lib/kdl/types/irl.rb', line 8 def unicode_search @unicode_search end |
#unicode_value ⇒ Object (readonly)
Returns the value of attribute unicode_value.
8 9 10 |
# File 'lib/kdl/types/irl.rb', line 8 def unicode_value @unicode_value end |
Class Method Details
.call(value, type = 'irl-reference') ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/kdl/types/irl.rb', line 23 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
31 32 33 |
# File 'lib/kdl/types/irl.rb', line 31 def self.parser(string) IRLReference::Parser.new(string) end |