module AfterShip::Attributes
Extracted attributes loading.
Public Instance Methods
load_attributes(data)
click to toggle source
Loop through the data hash and for each key call a setter with the value.
@param data [Hash]
# 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