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.
25 26 27 |
# File 'lib/ldpath/tests.rb', line 25 def initialize(lang) @lang = lang end |
Instance Attribute Details
#lang ⇒ Object (readonly)
Returns the value of attribute lang.
24 25 26 |
# File 'lib/ldpath/tests.rb', line 24 def lang @lang end |
Instance Method Details
#evaluate(_program, uri, _context) ⇒ Object
29 30 31 32 33 |
# File 'lib/ldpath/tests.rb', line 29 def evaluate(_program, uri, _context) return unless uri.literal? uri if (lang.to_s == "none" && !uri.has_language?) || uri.language.to_s == lang.to_s end |