Class: SurfReport::Report
- Inherits:
-
Object
- Object
- SurfReport::Report
- Defined in:
- lib/surf_report/report.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#date ⇒ Object
Returns the value of attribute date.
-
#forecast ⇒ Object
Returns the value of attribute forecast.
-
#name ⇒ Object
Returns the value of attribute name.
-
#surfer_dude_says ⇒ Object
Returns the value of attribute surfer_dude_says.
-
#swell_direction ⇒ Object
Returns the value of attribute swell_direction.
-
#url ⇒ Object
Returns the value of attribute url.
-
#wave_description ⇒ Object
Returns the value of attribute wave_description.
-
#wave_size ⇒ Object
Returns the value of attribute wave_size.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(report_hash) ⇒ Report
constructor
A new instance of Report.
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
#date ⇒ Object
Returns the value of attribute date.
2 3 4 |
# File 'lib/surf_report/report.rb', line 2 def date @date end |
#forecast ⇒ Object
Returns the value of attribute forecast.
2 3 4 |
# File 'lib/surf_report/report.rb', line 2 def forecast @forecast end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/surf_report/report.rb', line 2 def name @name end |
#surfer_dude_says ⇒ Object
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_direction ⇒ Object
Returns the value of attribute swell_direction.
2 3 4 |
# File 'lib/surf_report/report.rb', line 2 def swell_direction @swell_direction end |
#url ⇒ Object
Returns the value of attribute url.
2 3 4 |
# File 'lib/surf_report/report.rb', line 2 def url @url end |
#wave_description ⇒ Object
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_size ⇒ Object
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
.all ⇒ Object
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 |