Class: Reports
- Inherits:
-
Object
- Object
- Reports
- Defined in:
- lib/snowbowl/reports.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#base ⇒ Object
Returns the value of attribute base.
-
#date ⇒ Object
Returns the value of attribute date.
-
#top ⇒ Object
Returns the value of attribute top.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(date, top, base) ⇒ Reports
constructor
A new instance of Reports.
Constructor Details
#initialize(date, top, base) ⇒ Reports
Returns a new instance of Reports.
6 7 8 9 10 11 |
# File 'lib/snowbowl/reports.rb', line 6 def initialize(date, top, base) @date = date @top = top @base = base @@all << self end |
Instance Attribute Details
#base ⇒ Object
Returns the value of attribute base.
2 3 4 |
# File 'lib/snowbowl/reports.rb', line 2 def base @base end |
#date ⇒ Object
Returns the value of attribute date.
2 3 4 |
# File 'lib/snowbowl/reports.rb', line 2 def date @date end |
#top ⇒ Object
Returns the value of attribute top.
2 3 4 |
# File 'lib/snowbowl/reports.rb', line 2 def top @top end |
Class Method Details
.all ⇒ Object
19 20 21 |
# File 'lib/snowbowl/reports.rb', line 19 def self.all @@all end |
.create_from_scrape(data) ⇒ Object
13 14 15 16 17 |
# File 'lib/snowbowl/reports.rb', line 13 def self.create_from_scrape(data) data.each do |hash| self.new(hash[:date], hash[:top], hash[:base]) end end |