Module: Attributes
- Included in:
- AfterShip::Checkpoint, AfterShip::Tracking
- Defined in:
- lib/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.
6 7 8 9 10 11 |
# File 'lib/attributes.rb', line 6 def load_attributes(data) data.each do |attribute, value| setter = "#{ attribute }=" send(setter, value) if respond_to?(setter) end end |