Class: SagePay::Server::Address
- Inherits:
-
Object
- Object
- SagePay::Server::Address
- Includes:
- ActiveModel::Validations, Validators
- Defined in:
- lib/sage_pay/server/address.rb
Constant Summary
Constants included from Validators
Validators::ADDRESS_FORMAT, Validators::COUNTRY_OPTIONS, Validators::EMAIL_FORMAT, Validators::NAME_FORMAT, Validators::PHONE_FORMAT, Validators::POST_CODE_FORMAT, Validators::US_STATE_OPTIONS, Validators::VENDOR_NAME_FORMAT, Validators::VENDOR_TX_CODE_FORMAT
Instance Attribute Summary collapse
-
#address_1 ⇒ Object
Returns the value of attribute address_1.
-
#address_2 ⇒ Object
Returns the value of attribute address_2.
-
#city ⇒ Object
Returns the value of attribute city.
-
#country ⇒ Object
Returns the value of attribute country.
-
#first_names ⇒ Object
Returns the value of attribute first_names.
-
#phone ⇒ Object
Returns the value of attribute phone.
-
#post_code ⇒ Object
Returns the value of attribute post_code.
-
#state ⇒ Object
Returns the value of attribute state.
-
#surname ⇒ Object
Returns the value of attribute surname.
Instance Method Summary collapse
- #in_us? ⇒ Boolean
-
#initialize(attributes = {}) ⇒ Address
constructor
A new instance of Address.
Constructor Details
#initialize(attributes = {}) ⇒ Address
Returns a new instance of Address.
39 40 41 42 43 |
# File 'lib/sage_pay/server/address.rb', line 39 def initialize(attributes = {}) attributes.each do |k, v| send("#{k}=", v) end end |
Instance Attribute Details
#address_1 ⇒ Object
Returns the value of attribute address_1.
7 8 9 |
# File 'lib/sage_pay/server/address.rb', line 7 def address_1 @address_1 end |
#address_2 ⇒ Object
Returns the value of attribute address_2.
7 8 9 |
# File 'lib/sage_pay/server/address.rb', line 7 def address_2 @address_2 end |
#city ⇒ Object
Returns the value of attribute city.
7 8 9 |
# File 'lib/sage_pay/server/address.rb', line 7 def city @city end |
#country ⇒ Object
Returns the value of attribute country.
7 8 9 |
# File 'lib/sage_pay/server/address.rb', line 7 def country @country end |
#first_names ⇒ Object
Returns the value of attribute first_names.
7 8 9 |
# File 'lib/sage_pay/server/address.rb', line 7 def first_names @first_names end |
#phone ⇒ Object
Returns the value of attribute phone.
7 8 9 |
# File 'lib/sage_pay/server/address.rb', line 7 def phone @phone end |
#post_code ⇒ Object
Returns the value of attribute post_code.
7 8 9 |
# File 'lib/sage_pay/server/address.rb', line 7 def post_code @post_code end |
#state ⇒ Object
Returns the value of attribute state.
7 8 9 |
# File 'lib/sage_pay/server/address.rb', line 7 def state @state end |
#surname ⇒ Object
Returns the value of attribute surname.
7 8 9 |
# File 'lib/sage_pay/server/address.rb', line 7 def surname @surname end |
Instance Method Details
#in_us? ⇒ Boolean
45 46 47 |
# File 'lib/sage_pay/server/address.rb', line 45 def in_us? country == "US" end |