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.
46 47 48 49 50 |
# File 'lib/ldpath/tests.rb', line 46 def initialize(type) @type = type super end |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
44 45 46 |
# File 'lib/ldpath/tests.rb', line 44 def type @type end |
Instance Method Details
#evaluate(_program, uri, _context) ⇒ Object
52 53 54 55 56 |
# File 'lib/ldpath/tests.rb', line 52 def evaluate(_program, uri, _context) return unless uri.literal? uri if uri.has_datatype? && uri.datatype == type end |