Class: AuthorizeNet::LineItem

Inherits:
Object
  • Object
show all
Includes:
Model
Defined in:
lib/authorize_net/line_item.rb

Overview

Models an line item.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Model

#initialize, #to_a

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



8
9
10
# File 'lib/authorize_net/line_item.rb', line 8

def description
  @description
end

#idObject

Returns the value of attribute id.



8
9
10
# File 'lib/authorize_net/line_item.rb', line 8

def id
  @id
end

#nameObject

Returns the value of attribute name.



8
9
10
# File 'lib/authorize_net/line_item.rb', line 8

def name
  @name
end

#priceObject

Returns the value of attribute price.



8
9
10
# File 'lib/authorize_net/line_item.rb', line 8

def price
  @price
end

#quantityObject

Returns the value of attribute quantity.



8
9
10
# File 'lib/authorize_net/line_item.rb', line 8

def quantity
  @quantity
end

#taxableObject

Returns the value of attribute taxable.



8
9
10
# File 'lib/authorize_net/line_item.rb', line 8

def taxable
  @taxable
end

Instance Method Details

#to_hashObject



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/authorize_net/line_item.rb', line 10

def to_hash
  hash = {
    :line_item_id => @id,
    :line_item_name => @name,
    :line_item_description => @description,
    :line_item_quantity => @quantity,
    :line_item_price => @price,
    :line_item_taxable => @taxable
  }
  hash.delete_if {|k, v| v.nil?}
  hash
end