Class: Secretariat::TradeParty
- Inherits:
-
Struct
- Object
- Struct
- Secretariat::TradeParty
- Defined in:
- lib/secretariat/trade_party.rb
Instance Attribute Summary collapse
-
#city ⇒ Object
Returns the value of attribute city.
-
#country_id ⇒ Object
Returns the value of attribute country_id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#postal_code ⇒ Object
Returns the value of attribute postal_code.
-
#street1 ⇒ Object
Returns the value of attribute street1.
-
#street2 ⇒ Object
Returns the value of attribute street2.
-
#vat_id ⇒ Object
Returns the value of attribute vat_id.
Instance Method Summary collapse
Instance Attribute Details
#city ⇒ Object
Returns the value of attribute city
18 19 20 |
# File 'lib/secretariat/trade_party.rb', line 18 def city @city end |
#country_id ⇒ Object
Returns the value of attribute country_id
18 19 20 |
# File 'lib/secretariat/trade_party.rb', line 18 def country_id @country_id end |
#name ⇒ Object
Returns the value of attribute name
18 19 20 |
# File 'lib/secretariat/trade_party.rb', line 18 def name @name end |
#postal_code ⇒ Object
Returns the value of attribute postal_code
18 19 20 |
# File 'lib/secretariat/trade_party.rb', line 18 def postal_code @postal_code end |
#street1 ⇒ Object
Returns the value of attribute street1
18 19 20 |
# File 'lib/secretariat/trade_party.rb', line 18 def street1 @street1 end |
#street2 ⇒ Object
Returns the value of attribute street2
18 19 20 |
# File 'lib/secretariat/trade_party.rb', line 18 def street2 @street2 end |
#vat_id ⇒ Object
Returns the value of attribute vat_id
18 19 20 |
# File 'lib/secretariat/trade_party.rb', line 18 def vat_id @vat_id end |
Instance Method Details
#to_xml(xml, exclude_tax: false, version: 2) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/secretariat/trade_party.rb', line 22 def to_xml(xml, exclude_tax: false, version: 2) xml['ram'].Name name xml['ram'].PostalTradeAddress do xml['ram'].PostcodeCode postal_code xml['ram'].LineOne street1 if street2 && street2 != '' xml['ram'].LineTwo street2 end xml['ram'].CityName city xml['ram'].CountryID country_id end if !exclude_tax && vat_id && vat_id != '' xml['ram'].SpecifiedTaxRegistration do xml['ram'].ID(schemeID: 'VA') do xml.text(vat_id) end end end end |