Class: Tenet::MultiPages
- Inherits:
-
Object
- Object
- Tenet::MultiPages
- Defined in:
- lib/tenet/multi_pages.rb
Constant Summary collapse
- @@urls =
[]
- @@attributes =
[]
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ MultiPages
constructor
A new instance of MultiPages.
- #to_a ⇒ Array<Hash>
Constructor Details
#initialize ⇒ MultiPages
Returns a new instance of MultiPages.
25 26 27 28 29 30 31 32 |
# File 'lib/tenet/multi_pages.rb', line 25 def initialize @collection = [] @@urls.each do |url| html = Page.new(url).html @collection << Row.new(html, @@attributes).to_h end end |
Class Method Details
.attribute(name, css:, type: :string) ⇒ Object
20 21 22 |
# File 'lib/tenet/multi_pages.rb', line 20 def attribute(name, css:, type: :string) @@attributes << Attribute.new(name, css: css, type: type) end |
.urls(urls) ⇒ Object
11 12 13 |
# File 'lib/tenet/multi_pages.rb', line 11 def urls(urls) @@urls = urls end |
Instance Method Details
#to_a ⇒ Array<Hash>
37 38 39 |
# File 'lib/tenet/multi_pages.rb', line 37 def to_a @collection end |