Class: Ldpath::TypeTest
- Inherits:
-
TestSelector
- Object
- Selector
- TestSelector
- Ldpath::TypeTest
- Defined in:
- lib/ldpath/tests.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Attributes inherited from TestSelector
Instance Method Summary collapse
- #evaluate(program, uri, _context) ⇒ Object
-
#initialize(type) ⇒ TypeTest
constructor
A new instance of TypeTest.
Methods inherited from Selector
Constructor Details
#initialize(type) ⇒ TypeTest
Returns a new instance of TypeTest.
35 36 37 |
# File 'lib/ldpath/tests.rb', line 35 def initialize(type) @type = type end |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
34 35 36 |
# File 'lib/ldpath/tests.rb', line 34 def type @type end |
Instance Method Details
#evaluate(program, uri, _context) ⇒ Object
39 40 41 42 43 |
# File 'lib/ldpath/tests.rb', line 39 def evaluate(program, uri, _context) return unless uri.literal? uri if uri.has_datatype? && uri.datatype == type end |