Class: SurfReport::Report

Inherits:
Object
  • Object
show all
Defined in:
lib/surf_report/report.rb

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(report_hash) ⇒ Report

Returns a new instance of Report.



5
6
7
8
# File 'lib/surf_report/report.rb', line 5

def initialize(report_hash)
  report_hash.collect {|key, value| self.send(("#{key}="), value)}
  @@all << self
end

Instance Attribute Details

#dateObject

Returns the value of attribute date.



2
3
4
# File 'lib/surf_report/report.rb', line 2

def date
  @date
end

#forecastObject

Returns the value of attribute forecast.



2
3
4
# File 'lib/surf_report/report.rb', line 2

def forecast
  @forecast
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/surf_report/report.rb', line 2

def name
  @name
end

#surfer_dude_saysObject

Returns the value of attribute surfer_dude_says.



2
3
4
# File 'lib/surf_report/report.rb', line 2

def surfer_dude_says
  @surfer_dude_says
end

#swell_directionObject

Returns the value of attribute swell_direction.



2
3
4
# File 'lib/surf_report/report.rb', line 2

def swell_direction
  @swell_direction
end

#urlObject

Returns the value of attribute url.



2
3
4
# File 'lib/surf_report/report.rb', line 2

def url
  @url
end

#wave_descriptionObject

Returns the value of attribute wave_description.



2
3
4
# File 'lib/surf_report/report.rb', line 2

def wave_description
  @wave_description
end

#wave_sizeObject

Returns the value of attribute wave_size.



2
3
4
# File 'lib/surf_report/report.rb', line 2

def wave_size
  @wave_size
end

Class Method Details

.allObject



24
25
26
# File 'lib/surf_report/report.rb', line 24

def self.all
  @@all
end

.create_from_collection(days_array) ⇒ Object



10
11
12
# File 'lib/surf_report/report.rb', line 10

def self.create_from_collection(days_array)
  days_array.each{|day| self.new(day)}
end