Class: Ldpath::LanguageTest
- Inherits:
-
TestSelector
- Object
- Selector
- TestSelector
- Ldpath::LanguageTest
- Defined in:
- lib/ldpath/tests.rb
Instance Attribute Summary collapse
-
#lang ⇒ Object
readonly
Returns the value of attribute lang.
Attributes inherited from TestSelector
Instance Method Summary collapse
- #evaluate(program, uri, context) ⇒ Object
-
#initialize(lang) ⇒ LanguageTest
constructor
A new instance of LanguageTest.
Methods inherited from Selector
Constructor Details
#initialize(lang) ⇒ LanguageTest
Returns a new instance of LanguageTest.
23 24 25 |
# File 'lib/ldpath/tests.rb', line 23 def initialize lang @lang = lang end |
Instance Attribute Details
#lang ⇒ Object (readonly)
Returns the value of attribute lang.
22 23 24 |
# File 'lib/ldpath/tests.rb', line 22 def lang @lang end |
Instance Method Details
#evaluate(program, uri, context) ⇒ Object
27 28 29 30 31 32 |
# File 'lib/ldpath/tests.rb', line 27 def evaluate program, uri, context return unless uri.literal? if (lang == "none" && !uri.has_language?) or uri.language == lang uri end end |