Module: Wayfarer::Finders
- Included in:
- Page
- Defined in:
- lib/wayfarer/finders.rb
Instance Method Summary collapse
-
#images(*filters) ⇒ Array<URI>
Returns the expanded
src
attribute URIs from all or targeted<img>
tags. -
#javascripts(*filters) ⇒ Array<URI>
(also: #scripts)
Returns the expanded
src
attribute URIs from all or targeted<script>
tags. -
#links(*filters) ⇒ Array<URI>
Returns the expanded
href
attribute URIs from all or targeted<a>
tags. -
#stylesheets(*filters) ⇒ Array<URI>
Returns the expanded
href
attribute URIs from all or targeted<link rel="stylesheet" ...>
tags.
Instance Method Details
#images(*filters) ⇒ Array<URI>
Returns the expanded src
attribute URIs from all or targeted <img>
tags.
TODO: Tests
33 34 35 |
# File 'lib/wayfarer/finders.rb', line 33 def images(*filters) query("img", "src", *filters) end |
#javascripts(*filters) ⇒ Array<URI> Also known as: scripts
Returns the expanded src
attribute URIs from all or targeted <script>
tags.
TODO: Tests
23 24 25 |
# File 'lib/wayfarer/finders.rb', line 23 def javascripts(*filters) query("script", "src", *filters) end |
#links(*filters) ⇒ Array<URI>
Returns the expanded href
attribute URIs from all or targeted <a>
tags.
8 9 10 |
# File 'lib/wayfarer/finders.rb', line 8 def links(*filters) query("a", "href", *filters) end |
#stylesheets(*filters) ⇒ Array<URI>
Returns the expanded href
attribute URIs from all or targeted <link rel="stylesheet" ...>
tags.
15 16 17 |
# File 'lib/wayfarer/finders.rb', line 15 def stylesheets(*filters) query("link[rel='stylesheet']", "href", *filters) end |