Class: PrecipitationInfo
- Inherits:
-
Object
- Object
- PrecipitationInfo
- Defined in:
- lib/precipitationinfo.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#chance_of_rainbow ⇒ Object
readonly
Returns the value of attribute chance_of_rainbow.
-
#chance_to_continue ⇒ Object
readonly
Returns the value of attribute chance_to_continue.
-
#max_temp ⇒ Object
readonly
Returns the value of attribute max_temp.
-
#min_temp ⇒ Object
readonly
Returns the value of attribute min_temp.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#not_allowed_in ⇒ Object
readonly
Returns the value of attribute not_allowed_in.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, min_temp = nil, max_temp = nil, chance_to_continue = 0, chance_of_rainbow = 0, not_allowed_in = []) ⇒ PrecipitationInfo
constructor
A new instance of PrecipitationInfo.
Constructor Details
#initialize(name, min_temp = nil, max_temp = nil, chance_to_continue = 0, chance_of_rainbow = 0, not_allowed_in = []) ⇒ PrecipitationInfo
Returns a new instance of PrecipitationInfo.
18 19 20 21 22 23 24 25 |
# File 'lib/precipitationinfo.rb', line 18 def initialize(name, min_temp=nil, max_temp=nil, chance_to_continue=0, chance_of_rainbow=0, not_allowed_in=[]) @name = name @min_temp = min_temp @max_temp = max_temp @chance_to_continue = chance_to_continue || 0 @chance_of_rainbow = chance_of_rainbow || 0 @not_allowed_in = not_allowed_in || [] end |
Instance Attribute Details
#chance_of_rainbow ⇒ Object (readonly)
Returns the value of attribute chance_of_rainbow.
6 7 8 |
# File 'lib/precipitationinfo.rb', line 6 def chance_of_rainbow @chance_of_rainbow end |
#chance_to_continue ⇒ Object (readonly)
Returns the value of attribute chance_to_continue.
5 6 7 |
# File 'lib/precipitationinfo.rb', line 5 def chance_to_continue @chance_to_continue end |
#max_temp ⇒ Object (readonly)
Returns the value of attribute max_temp.
4 5 6 |
# File 'lib/precipitationinfo.rb', line 4 def max_temp @max_temp end |
#min_temp ⇒ Object (readonly)
Returns the value of attribute min_temp.
3 4 5 |
# File 'lib/precipitationinfo.rb', line 3 def min_temp @min_temp end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
2 3 4 |
# File 'lib/precipitationinfo.rb', line 2 def name @name end |
#not_allowed_in ⇒ Object (readonly)
Returns the value of attribute not_allowed_in.
7 8 9 |
# File 'lib/precipitationinfo.rb', line 7 def not_allowed_in @not_allowed_in end |
Class Method Details
.create_from_data(arg_hash) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/precipitationinfo.rb', line 9 def self.create_from_data(arg_hash) PrecipitationInfo.new(arg_hash[:name], arg_hash[:min_temp], arg_hash[:max_temp], arg_hash[:chance_to_continue], arg_hash[:chance_of_rainbow], arg_hash[:not_allowed_in]) end |