Class: PrecipitationOccurance

Inherits:
RangeHash
  • Object
show all
Defined in:
lib/precipitationoccurance.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ PrecipitationOccurance

Returns a new instance of PrecipitationOccurance.



15
16
17
18
# File 'lib/precipitationoccurance.rb', line 15

def initialize(args = {})
  super NullPrecipitationInfo.new()
  merge!(args)
end

Class Method Details

.load(file) ⇒ Object



9
10
11
12
13
# File 'lib/precipitationoccurance.rb', line 9

def self.load(file)
  data = YAML.load_file(file)
  data.each_pair { |k, v| data[k] = PrecipitationInfo.create_from_data(v)}
  PrecipitationOccurance.new(data)
end

Instance Method Details

#type(dieroller, temp_range = nil, terrain = :plains) ⇒ Object



20
21
22
# File 'lib/precipitationoccurance.rb', line 20

def type(dieroller, temp_range = nil, terrain = :plains)
  get_all_precip initial_precip(dieroller, temp_range, terrain), dieroller, temp_range, terrain
end