Class: Reports

Inherits:
Object
  • Object
show all
Defined in:
lib/snowbowl/reports.rb

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#baseObject

Returns the value of attribute base.



2
3
4
# File 'lib/snowbowl/reports.rb', line 2

def base
  @base
end

#dateObject

Returns the value of attribute date.



2
3
4
# File 'lib/snowbowl/reports.rb', line 2

def date
  @date
end

#topObject

Returns the value of attribute top.



2
3
4
# File 'lib/snowbowl/reports.rb', line 2

def top
  @top
end

Class Method Details

.allObject



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