Class: XmlConv::I2::Address
- Inherits:
-
Object
- Object
- XmlConv::I2::Address
- Defined in:
- lib/xmlconv/i2/address.rb
Constant Summary collapse
- I2_ADDR_CODES =
{ :buyer => 'BY', :delivery => 'DP', :employee => 'EP', :customer => 'CU', }
Instance Attribute Summary collapse
-
#city ⇒ Object
Returns the value of attribute city.
-
#code ⇒ Object
Returns the value of attribute code.
-
#country ⇒ Object
Returns the value of attribute country.
-
#name1 ⇒ Object
Returns the value of attribute name1.
-
#name2 ⇒ Object
Returns the value of attribute name2.
-
#party_id ⇒ Object
Returns the value of attribute party_id.
-
#street1 ⇒ Object
Returns the value of attribute street1.
-
#street2 ⇒ Object
Returns the value of attribute street2.
-
#zip_code ⇒ Object
Returns the value of attribute zip_code.
Instance Method Summary collapse
-
#initialize ⇒ Address
constructor
A new instance of Address.
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ Address
Returns a new instance of Address.
16 17 18 |
# File 'lib/xmlconv/i2/address.rb', line 16 def initialize @code = :buyer end |
Instance Attribute Details
#city ⇒ Object
Returns the value of attribute city.
8 9 10 |
# File 'lib/xmlconv/i2/address.rb', line 8 def city @city end |
#code ⇒ Object
Returns the value of attribute code.
7 8 9 |
# File 'lib/xmlconv/i2/address.rb', line 7 def code @code end |
#country ⇒ Object
Returns the value of attribute country.
8 9 10 |
# File 'lib/xmlconv/i2/address.rb', line 8 def country @country end |
#name1 ⇒ Object
Returns the value of attribute name1.
8 9 10 |
# File 'lib/xmlconv/i2/address.rb', line 8 def name1 @name1 end |
#name2 ⇒ Object
Returns the value of attribute name2.
8 9 10 |
# File 'lib/xmlconv/i2/address.rb', line 8 def name2 @name2 end |
#party_id ⇒ Object
Returns the value of attribute party_id.
7 8 9 |
# File 'lib/xmlconv/i2/address.rb', line 7 def party_id @party_id end |
#street1 ⇒ Object
Returns the value of attribute street1.
8 9 10 |
# File 'lib/xmlconv/i2/address.rb', line 8 def street1 @street1 end |
#street2 ⇒ Object
Returns the value of attribute street2.
8 9 10 |
# File 'lib/xmlconv/i2/address.rb', line 8 def street2 @street2 end |
#zip_code ⇒ Object
Returns the value of attribute zip_code.
8 9 10 |
# File 'lib/xmlconv/i2/address.rb', line 8 def zip_code @zip_code end |
Instance Method Details
#to_s ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/xmlconv/i2/address.rb', line 19 def to_s output = [] numerals = [ 201, 202, 220, 221, 222, 223, 224, 225, 226 ] [ I2_ADDR_CODES[@code], @party_id, @name1, @name2, @street1, @city, @country, @zip_code, @street2, ].each_with_index { |value, idx| unless(value.nil?) output << "#{numerals[idx]}:#{value}" end } output.join("\n") << "\n" end |