Class: SimpleShipping::Demo::Base
- Inherits:
-
Object
- Object
- SimpleShipping::Demo::Base
- Defined in:
- lib/simple_shipping/demo/base.rb
Overview
Base class for UPS and FedEx demos.
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#recipient ⇒ SimpleShipping::Party
Build the recipient object.
-
#recipient_address ⇒ SimpleShipping::Address
Build the recipient address with random attributes.
-
#recipient_contact ⇒ SimpleShipping::Contact
Build the recipient contact.
-
#shipper ⇒ SimpleShipping::Party
Build the shipper object.
-
#shipper_address ⇒ SimpleShipping::Address
Build the shipper address with random attributes.
-
#shipper_contact ⇒ SimpleShipping::Contact
Build the shipper contact object.
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/simple_shipping/demo/base.rb', line 3 def @options end |
Instance Method Details
#recipient ⇒ SimpleShipping::Party
Build the recipient object.
65 66 67 68 69 70 |
# File 'lib/simple_shipping/demo/base.rb', line 65 def recipient @recipient ||= SimpleShipping::Party.new( :address => recipient_address, :contact => recipient_contact ) end |
#recipient_address ⇒ SimpleShipping::Address
Build the recipient address with random attributes.
42 43 44 45 46 47 48 49 50 |
# 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 ⇒ SimpleShipping::Contact
Build the recipient contact.
55 56 57 58 59 60 |
# 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 ⇒ SimpleShipping::Party
Build the shipper object.
31 32 33 34 35 36 37 |
# File 'lib/simple_shipping/demo/base.rb', line 31 def shipper @shipper ||= SimpleShipping::Party.new( :address => shipper_address, :contact => shipper_contact, :account_number => [:account_number] ) end |
#shipper_address ⇒ SimpleShipping::Address
Build the shipper address with random attributes.
8 9 10 11 12 13 14 15 16 |
# 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 ⇒ SimpleShipping::Contact
Build the shipper contact object.
21 22 23 24 25 26 |
# 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 |