Class: Ldpath::TypeTest

Inherits:
TestSelector show all
Defined in:
lib/ldpath/tests.rb

Instance Attribute Summary collapse

Attributes inherited from TestSelector

#delegate, #test

Instance Method Summary collapse

Methods inherited from Selector

#loading

Constructor Details

#initialize(type) ⇒ TypeTest

Returns a new instance of TypeTest.



37
38
39
# File 'lib/ldpath/tests.rb', line 37

def initialize type
  @type = type
end

Instance Attribute Details

#type ⇒ Object (readonly)

Returns the value of attribute type.



36
37
38
# File 'lib/ldpath/tests.rb', line 36

def type
  @type
end

Instance Method Details

#evaluate(program, uri, context) ⇒ Object



41
42
43
44
45
46
# File 'lib/ldpath/tests.rb', line 41

def evaluate program, uri, context
  return unless uri.literal?
  if uri.has_datatype? and uri.datatype == type
    uri
  end
end