Module: Mspire::Mascot::Dat::Section::KeyVal

Included in:
Header, Masses, Parameters
Defined in:
lib/mspire/mascot/dat/section/key_val.rb

Instance Method Summary collapse

Instance Method Details

#from_io!(io, as_symbols = true) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/mspire/mascot/dat/section/key_val.rb', line 7

def from_io!(io, as_symbols=true)
  Dat.each_key_val(io) do |key,val| 
    self[ as_symbols ? key.to_sym : key ] = val
  end
  self.send(:cast!) if self.respond_to?(:cast!)
  self
end