Method: Ballistics::Atmosphere#initialize
- Defined in:
- lib/ballistics/atmosphere.rb
#initialize(hsh = ARMY.dup) ⇒ Atmosphere
Returns a new instance of Atmosphere.
94 95 96 97 98 99 100 101 |
# File 'lib/ballistics/atmosphere.rb', line 94 def initialize(hsh = ARMY.dup) @yaml_data = hsh MANDATORY.each { |field, type| val = hsh[field] || hsh[field.to_sym] or raise("#{field} not provided") Ballistics::YAML.check_type!(val, type) self.instance_variable_set("@#{field}", val.to_d) } end |