Module: Kiosk::ProspectiveNode
- Defined in:
- lib/kiosk/prospective_node.rb
Instance Method Summary collapse
-
#match_uri(pattern, shim_patterns = {}) ⇒ Object
Attempts to match the given pattern against the resource URI.
-
#resource_uri ⇒ Object
Returns either the nodes
href
orsrc
attribute as a parsedResourceURI
.
Instance Method Details
#match_uri(pattern, shim_patterns = {}) ⇒ Object
Attempts to match the given pattern against the resource URI.
5 6 7 8 9 |
# File 'lib/kiosk/prospective_node.rb', line 5 def match_uri(pattern, shim_patterns = {}) resource_uri.match(pattern, shim_patterns) rescue URI::BadURIError, URI::InvalidURIError nil end |
#resource_uri ⇒ Object
Returns either the nodes href
or src
attribute as a parsed ResourceURI
.
14 15 16 |
# File 'lib/kiosk/prospective_node.rb', line 14 def resource_uri ResourceURI.parse(self['href'] || self['src'] || '') end |