Class: Sepa::DirectDebitOrder::Party
- Inherits:
-
Object
- Object
- Sepa::DirectDebitOrder::Party
- Defined in:
- lib/sepa/direct_debit_order.rb
Instance Attribute Summary collapse
-
#address_line_1 ⇒ Object
Returns the value of attribute address_line_1.
-
#address_line_2 ⇒ Object
Returns the value of attribute address_line_2.
-
#contact_email ⇒ Object
Returns the value of attribute contact_email.
-
#contact_name ⇒ Object
Returns the value of attribute contact_name.
-
#contact_phone ⇒ Object
Returns the value of attribute contact_phone.
-
#country ⇒ Object
Returns the value of attribute country.
-
#name ⇒ Object
Returns the value of attribute name.
-
#postcode ⇒ Object
Returns the value of attribute postcode.
-
#town ⇒ Object
Returns the value of attribute town.
Instance Method Summary collapse
-
#initialize(name, address_line_1, address_line_2, postcode, town, country, contact_name, contact_phone, contact_email) ⇒ Party
constructor
A new instance of Party.
- #to_properties(prefix) ⇒ Object
Constructor Details
#initialize(name, address_line_1, address_line_2, postcode, town, country, contact_name, contact_phone, contact_email) ⇒ Party
Returns a new instance of Party.
38 39 40 41 |
# File 'lib/sepa/direct_debit_order.rb', line 38 def initialize name, address_line_1, address_line_2, postcode, town, country, contact_name, contact_phone, contact_email @name, @address_line_1, @address_line_2, @postcode, @town, @country = name, address_line_1, address_line_2, postcode, town, country @contact_name, @contact_phone, @contact_email = contact_name, contact_phone, contact_email end |
Instance Attribute Details
#address_line_1 ⇒ Object
Returns the value of attribute address_line_1.
36 37 38 |
# File 'lib/sepa/direct_debit_order.rb', line 36 def address_line_1 @address_line_1 end |
#address_line_2 ⇒ Object
Returns the value of attribute address_line_2.
36 37 38 |
# File 'lib/sepa/direct_debit_order.rb', line 36 def address_line_2 @address_line_2 end |
#contact_email ⇒ Object
Returns the value of attribute contact_email.
36 37 38 |
# File 'lib/sepa/direct_debit_order.rb', line 36 def contact_email @contact_email end |
#contact_name ⇒ Object
Returns the value of attribute contact_name.
36 37 38 |
# File 'lib/sepa/direct_debit_order.rb', line 36 def contact_name @contact_name end |
#contact_phone ⇒ Object
Returns the value of attribute contact_phone.
36 37 38 |
# File 'lib/sepa/direct_debit_order.rb', line 36 def contact_phone @contact_phone end |
#country ⇒ Object
Returns the value of attribute country.
36 37 38 |
# File 'lib/sepa/direct_debit_order.rb', line 36 def country @country end |
#name ⇒ Object
Returns the value of attribute name.
36 37 38 |
# File 'lib/sepa/direct_debit_order.rb', line 36 def name @name end |
#postcode ⇒ Object
Returns the value of attribute postcode.
36 37 38 |
# File 'lib/sepa/direct_debit_order.rb', line 36 def postcode @postcode end |
#town ⇒ Object
Returns the value of attribute town.
36 37 38 |
# File 'lib/sepa/direct_debit_order.rb', line 36 def town @town end |
Instance Method Details
#to_properties(prefix) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/sepa/direct_debit_order.rb', line 43 def to_properties prefix hsh = { "#{prefix}.name" => name, "#{prefix}.postal_address.address_line[0]" => address_line_1, "#{prefix}.postal_address.post_code" => postcode, "#{prefix}.postal_address.town_name" => town, "#{prefix}.postal_address.country" => country, "#{prefix}.contact_details.name" => contact_name, "#{prefix}.contact_details.phone_number" => contact_phone, "#{prefix}.contact_details.email_address" => contact_email, } hsh["#{prefix}.postal_address.address_line[1]"] = address_line_2 if address_line_2 hsh end |