Class: AuthorizeNet::ARB::Sorting

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Model

#to_a

Constructor Details

#initialize(order_by, order_descending) ⇒ Sorting

Initializes Sorting object.

Typical usage:

sorting = AuthorizeNet::ARB::Sorting.new('name',true)

Valid values for order_by values of the AuthorizeNet::ARB::Sorting:

id
name
status
createTimeStampUTC
lastName
firstName
accountNumber
amount
pastOccurrences

Valid values for order_descending: true, false, 1, 0



28
29
30
31
# File 'lib/authorize_net/arb/sorting.rb', line 28

def initialize(order_by, order_descending)
  @order_by = order_by
  @order_descending = order_descending
end

Instance Attribute Details

#order_byObject

Returns the value of attribute order_by.



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

def order_by
  @order_by
end

#order_descendingObject

Returns the value of attribute order_descending.



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

def order_descending
  @order_descending
end

Instance Method Details

#to_hashObject



33
34
35
36
37
38
39
# File 'lib/authorize_net/arb/sorting.rb', line 33

def to_hash
  hash = {
    :order_by => @order_by,
    :order_descending => @order_descending
  }
  hash.delete_if {|k, v| v.nil?}
end