Class: AlphaCard::Shipping

Inherits:
AlphaCardObject show all
Defined in:
lib/alpha_card/objects/shipping.rb

Overview

Implementation of Alpha Card Services order shipping information. Contains all the shipping information (address, city, zip, etc).

Instance Method Summary collapse

Instance Method Details

#filled_attributesHash

Overloaded filled_attributes method from AlphaCard::AlphaCardObject. All attribute names of the Alpha Card Shipping object must start with “shipping_” prefix.

Examples:

shipping = AlphaCard::Shipping.new({firstname: 'John', state: 'NY'})
shipping.filled_attributes

#=> {shipping_firstname: 'John', shipping_state: 'NY'}

Returns:

  • (Hash)

    attributes Only filled attributes of Shipping resource with “shipping_” prefix.



31
32
33
# File 'lib/alpha_card/objects/shipping.rb', line 31

def filled_attributes
  Hash[super.map { |k, v| ["shipping_#{k}".to_sym, v] }]
end