Class: Temando::Api::Entities::Anywhere

Inherits:
Object
  • Object
show all
Defined in:
lib/temando/api/entities/anywhere.rb

Instance Method Summary collapse

Constructor Details

#initialize(anywhere) ⇒ Anywhere

Returns a new instance of Anywhere.



4
5
6
# File 'lib/temando/api/entities/anywhere.rb', line 4

def initialize(anywhere)
  @anywhere = anywhere
end

Instance Method Details

#build_xml(xml) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/temando/api/entities/anywhere.rb', line 8

def build_xml(xml)
  xml.anywhere do
    xml.parent.namespace = nil
    xml.itemNature @anywhere.shipping_nature
    xml.itemMethod @anywhere.shipping_method
    xml.originCountry @anywhere.origin.country
    xml.originCode @anywhere.origin.postcode
    xml.originSuburb @anywhere.origin.suburb
    xml.destinationCountry @anywhere.destination.country
    xml.destinationCode @anywhere.destination.postcode
    xml.destinationSuburb @anywhere.destination.suburb
    xml.destinationIs 'Residence'
    xml.destinationResNotifyBefore 'N'
    xml.destinationResLimitedAccess 'N'
    xml.originIs 'Business'
    xml.originBusNotifyBefore 'Y'
    xml.originBusLimitedAccess 'N'
  end
end