Class: AlphaCard::AlphaCardObject

Inherits:
Object
  • Object
show all
Defined in:
lib/alpha_card/alpha_card_object.rb

Overview

Parent class for each Alpha Card Gateway object, such as Order, Billing, Sale and others.

Direct Known Subclasses

Account, Billing, Order, Sale, Shipping

Instance Method Summary collapse

Instance Method Details

#filled_attributesHash

Returns the Hash with only filled attributes of the AlphaCard::AlphaCardObject.

Examples:

order = AlphaCard::Order.new({orderid: '1', tax: nil, ponumber: 'PO123'})
order.filled_attributes

#=> {orderid: '1', ponumber: 'PO123'}

20
21
22
# File 'lib/alpha_card/alpha_card_object.rb', line 20

def filled_attributes
  attributes.select { |_, value| !value.nil? }
end