Class: Peddler::Refunds::Item

Inherits:
Object
  • Object
show all
Defined in:
lib/peddler/refunds.rb

Overview

This is a refund.

Constant Summary collapse

REFUND_REASONS =
%w{ GeneralAdjustment CouldNotShip DifferentItem MerchandiseNotReceived MerchandiseNotAsDescribed }

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Item

Returns a new instance of Item.



39
40
41
# File 'lib/peddler/refunds.rb', line 39

def initialize(options={})
  options.each_pair{ |key, value| send("#{key.to_s}=", value) }
end

Instance Attribute Details

#messageObject

Returns the value of attribute message.



36
37
38
# File 'lib/peddler/refunds.rb', line 36

def message
  @message
end

#order_idObject

Returns the value of attribute order_id.



36
37
38
# File 'lib/peddler/refunds.rb', line 36

def order_id
  @order_id
end

#payments_transaction_idObject

Returns the value of attribute payments_transaction_id.



36
37
38
# File 'lib/peddler/refunds.rb', line 36

def payments_transaction_id
  @payments_transaction_id
end

#reasonObject

Returns the value of attribute reason.



37
38
39
# File 'lib/peddler/refunds.rb', line 37

def reason
  @reason
end

#refund_amountObject

Returns the value of attribute refund_amount.



36
37
38
# File 'lib/peddler/refunds.rb', line 36

def refund_amount
  @refund_amount
end

Instance Method Details

#to_sObject



47
48
49
# File 'lib/peddler/refunds.rb', line 47

def to_s
  "#{self.order_id}\t#{self.payments_transaction_id}\t#{self.refund_amount}\t#{self.reason}\t#{self.message}\r\n"
end