Module: AfterShip::Attributes
- Included in:
- Checkpoint, Courier, Tracking
- Defined in:
- lib/after_ship/core/attributes.rb
Overview
Extracted attributes loading.
Instance Method Summary collapse
-
#load_attributes(data) ⇒ Object
Loop through the data hash and for each key call a setter with the value.
Instance Method Details
#load_attributes(data) ⇒ Object
Loop through the data hash and for each key call a setter with the value.
7 8 9 10 11 12 |
# File 'lib/after_ship/core/attributes.rb', line 7 def load_attributes(data) data.each do |attribute, value| setter = "#{attribute}=" send(setter, value) if respond_to?(setter) end end |