Class: Lutaml::Rdf::MappingRule
- Inherits:
-
Object
- Object
- Lutaml::Rdf::MappingRule
- Defined in:
- lib/lutaml/rdf/mapping_rule.rb
Instance Attribute Summary collapse
-
#lang_tagged ⇒ Object
readonly
Returns the value of attribute lang_tagged.
-
#namespace ⇒ Object
readonly
Returns the value of attribute namespace.
-
#predicate_name ⇒ Object
readonly
Returns the value of attribute predicate_name.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
Instance Method Summary collapse
-
#initialize(predicate_name, namespace:, to:, lang_tagged: false) ⇒ MappingRule
constructor
A new instance of MappingRule.
- #prefixed_name ⇒ Object
- #uri ⇒ Object
Constructor Details
#initialize(predicate_name, namespace:, to:, lang_tagged: false) ⇒ MappingRule
Returns a new instance of MappingRule.
8 9 10 11 12 13 14 |
# File 'lib/lutaml/rdf/mapping_rule.rb', line 8 def initialize(predicate_name, namespace:, to:, lang_tagged: false) validate!(predicate_name, namespace, to) @predicate_name = predicate_name.to_s.freeze @namespace = namespace @to = to @lang_tagged = lang_tagged end |
Instance Attribute Details
#lang_tagged ⇒ Object (readonly)
Returns the value of attribute lang_tagged.
6 7 8 |
# File 'lib/lutaml/rdf/mapping_rule.rb', line 6 def lang_tagged @lang_tagged end |
#namespace ⇒ Object (readonly)
Returns the value of attribute namespace.
6 7 8 |
# File 'lib/lutaml/rdf/mapping_rule.rb', line 6 def namespace @namespace end |
#predicate_name ⇒ Object (readonly)
Returns the value of attribute predicate_name.
6 7 8 |
# File 'lib/lutaml/rdf/mapping_rule.rb', line 6 def predicate_name @predicate_name end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
6 7 8 |
# File 'lib/lutaml/rdf/mapping_rule.rb', line 6 def to @to end |
Instance Method Details
#prefixed_name ⇒ Object
20 21 22 |
# File 'lib/lutaml/rdf/mapping_rule.rb', line 20 def prefixed_name @namespace.prefixed(@predicate_name) end |
#uri ⇒ Object
16 17 18 |
# File 'lib/lutaml/rdf/mapping_rule.rb', line 16 def uri @namespace[@predicate_name] end |