Method: Megam::Promos#from_hash
- Defined in:
- lib/megam/core/promos.rb
#from_hash(o) ⇒ Object
124 125 126 127 128 129 130 |
# File 'lib/megam/core/promos.rb', line 124 def from_hash(o) @id = o[:id] if o.has_key?(:id) @code = o[:name] if o.has_key?(:name) @amount = o[:credit] if o.has_key?(:credit) @created_at = o[:created_at] if o.has_key?(:created_at) self end |