Class: AuthorizeNet::Reporting::ReturnedItem
- Inherits:
-
Object
- Object
- AuthorizeNet::Reporting::ReturnedItem
- Includes:
- Model
- Defined in:
- lib/authorize_net/reporting/returned_item.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#date_local ⇒ Object
Returns the value of attribute date_local.
-
#date_utc ⇒ Object
Returns the value of attribute date_utc.
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#returned_items ⇒ Object
Returns the value of attribute returned_items.
Instance Method Summary collapse
- #add_returned_item(id = nil, date_utc = nil, date_local = nil, code = nil, description = nil) ⇒ Object
- #to_hash ⇒ Object
Methods included from Model
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
6 7 8 |
# File 'lib/authorize_net/reporting/returned_item.rb', line 6 def code @code end |
#date_local ⇒ Object
Returns the value of attribute date_local.
6 7 8 |
# File 'lib/authorize_net/reporting/returned_item.rb', line 6 def date_local @date_local end |
#date_utc ⇒ Object
Returns the value of attribute date_utc.
6 7 8 |
# File 'lib/authorize_net/reporting/returned_item.rb', line 6 def date_utc @date_utc end |
#description ⇒ Object
Returns the value of attribute description.
6 7 8 |
# File 'lib/authorize_net/reporting/returned_item.rb', line 6 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
6 7 8 |
# File 'lib/authorize_net/reporting/returned_item.rb', line 6 def id @id end |
#returned_items ⇒ Object
Returns the value of attribute returned_items.
6 7 8 |
# File 'lib/authorize_net/reporting/returned_item.rb', line 6 def returned_items @returned_items end |
Instance Method Details
#add_returned_item(id = nil, date_utc = nil, date_local = nil, code = nil, description = nil) ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/authorize_net/reporting/returned_item.rb', line 24 def add_returned_item(id = nil, date_utc = nil, date_local = nil, code = nil, description = nil) if id.kind_of?(AuthorizeNet::Reporting::ReturnedItem) returned_item = id else returned_item = AuthorizeNet::Reporting::ReturnedItem.new({:return_item_id => id, :return_item_date_utc => date_utc, :return_item_date_local => date_local, :return_item_code => code, :line_item_description => description}) end @returned_items = @returned_items.to_a << returned_item end |
#to_hash ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/authorize_net/reporting/returned_item.rb', line 33 def to_hash hash = { :id => @id, :date_utc => @date_utc, :date_local => @date_local, :code => @code, :description => @description, :returned_items => handle_multivalue_hashing(@returned_items) } hash.delete_if { |k, v| v.nil? } hash end |