Class: IFormat::Order

Inherits:
Base
  • Object
show all
Defined in:
lib/iformat/order.rb

Instance Attribute Summary

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Methods inherited from Base

#[], #initialize, lazy_attr_reader

Constructor Details

This class inherits a constructor from IFormat::Base

Instance Method Details

#==(other) ⇒ Boolean

Parameters:

Returns:

  • (Boolean)


22
23
24
# File 'lib/iformat/order.rb', line 22

def ==(other)
  super || (other.class == self.class && other.id == self.id)
end

#created_atObject



12
13
14
# File 'lib/iformat/order.rb', line 12

def created_at
  @created_at ||= @attrs[:date]
end

#idObject



8
9
10
# File 'lib/iformat/order.rb', line 8

def id
  @id ||= @attrs[:order_id]
end

#net_amountObject



16
17
18
# File 'lib/iformat/order.rb', line 16

def net_amount
  @net_amount ||= BigDecimal.new(@attrs[:price] || '0')
end