Class: Hash
Instance Method Summary collapse
Instance Method Details
#permit_and_default!(**args) ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/rubimc/ruby_classes.rb', line 39 def permit_and_default! (**args) self.keys.each do |param| if not args.keys.include? param mname = caller_locations(1)[2].label perror "Method '#{mname}' have no param: #{param}}" end end args.keys.each do |param| self[param] = args[param] if self[param].nil? end end |