class SimpleShipping::Demo::Base

Base class for UPS and FedEx demos.

Attributes

options[R]

Public Instance Methods

recipient() click to toggle source

Build the recipient object.

@return [SimpleShipping::Party]

# File lib/simple_shipping/demo/base.rb, line 65
def recipient
  @recipient ||= SimpleShipping::Party.new(
    :address        => recipient_address,
    :contact        => recipient_contact
)
end
recipient_address() click to toggle source

Build the recipient address with random attributes.

@return [SimpleShipping::Address]

# File lib/simple_shipping/demo/base.rb, line 42
def recipient_address
  @recipient_address ||= SimpleShipping::Address.new(
      :country_code => 'US',
      :state_code   => 'MN',
      :city         => 'Minneapolis',
      :street_line  => 'Nightmare Avenue 13',
      :postal_code  => '55411'
  )
end
recipient_contact() click to toggle source

Build the recipient contact.

@return [SimpleShipping::Contact]

# File lib/simple_shipping/demo/base.rb, line 55
def recipient_contact
  @recipient_contact ||= SimpleShipping::Contact.new(
    :person_name  => "John Recipient Smith",
    :phone_number => "1234567890"
)
end
shipper() click to toggle source

Build the shipper object.

@return [SimpleShipping::Party]

# File lib/simple_shipping/demo/base.rb, line 31
def shipper
  @shipper ||= SimpleShipping::Party.new(
      :address => shipper_address,
      :contact => shipper_contact,
      :account_number => options[:account_number]
  )
end
shipper_address() click to toggle source

Build the shipper address with random attributes.

@return [SimpleShipping::Address]

# File lib/simple_shipping/demo/base.rb, line 8
def shipper_address
  @shipper_address ||= SimpleShipping::Address.new(
      :country_code => 'US',
      :state_code   => 'TX',
      :city         => 'Texas',
      :street_line  => 'SN2000 Test Meter 8',
      :postal_code  => '73301'
  )
end
shipper_contact() click to toggle source

Build the shipper contact object.

@return [SimpleShipping::Contact]

# File lib/simple_shipping/demo/base.rb, line 21
def shipper_contact
  @shipper_contact ||= SimpleShipping::Contact.new(
      :person_name  => 'Mister Someone',
      :phone_number => '1234567890'
  )
end