Module: HashInit
- Included in:
- MrMurano::ExchangeElement
- Defined in:
- lib/MrMurano/hash.rb
Instance Method Summary collapse
Instance Method Details
#initialize(*hash) ⇒ Object
202 203 204 205 206 207 208 209 210 211 |
# File 'lib/MrMurano/hash.rb', line 202 def initialize(*hash) return unless hash.length == 1 && hash.first.is_a?(Hash) hash.first.each do |key, val| if respond_to? key send("#{key}=", val) elsif defined?(@show_errors) && @show_errors warn %(HashInit: missing hash key "#{key}") end end end |