Module: Nuvemshop::Extensions::MassAssignment
- Included in:
- BaseModel
- Defined in:
- lib/nuvemshop/extensions/mass_assignment.rb
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Object
Assigns getter and setter for each pair key/value.
Instance Method Details
#initialize(opts = {}) ⇒ Object
Assigns getter and setter for each pair key/value
5 6 7 8 9 |
# File 'lib/nuvemshop/extensions/mass_assignment.rb', line 5 def initialize(opts = {}) before_initialize if respond_to?(:before_initialize, true) opts&.each { |key, value| public_send("#{key.to_sym}=", value) } after_initialize if respond_to?(:after_initialize, true) end |