Class: Braspag::Address
- Inherits:
-
Object
- Object
- Braspag::Address
- Defined in:
- lib/braspag/api/address.rb
Overview
Customer’s address.
Instance Attribute Summary collapse
-
#city ⇒ String
the city of customer’s address.
-
#complement ⇒ String
any complement of customer’s address.
-
#country ⇒ String
the country of customer’s address.
-
#number ⇒ String
the customer’s address number.
-
#state ⇒ String
the state of customer’s address.
-
#street ⇒ String
the customer’s address.
-
#zip_code ⇒ String
the zip code of customer’s address.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#city ⇒ String
the city of customer’s address
11 12 13 |
# File 'lib/braspag/api/address.rb', line 11 def city @city end |
#complement ⇒ String
any complement of customer’s address
11 12 13 |
# File 'lib/braspag/api/address.rb', line 11 def complement @complement end |
#country ⇒ String
the country of customer’s address
11 12 13 |
# File 'lib/braspag/api/address.rb', line 11 def country @country end |
#number ⇒ String
the customer’s address number
11 12 13 |
# File 'lib/braspag/api/address.rb', line 11 def number @number end |
#state ⇒ String
the state of customer’s address
11 12 13 |
# File 'lib/braspag/api/address.rb', line 11 def state @state end |
#street ⇒ String
the customer’s address
11 12 13 |
# File 'lib/braspag/api/address.rb', line 11 def street @street end |
#zip_code ⇒ String
the zip code of customer’s address
11 12 13 |
# File 'lib/braspag/api/address.rb', line 11 def zip_code @zip_code end |
Class Method Details
.from_json(data) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/braspag/api/address.rb', line 26 def self.from_json(data) if (data != nil) address = Address.new address.street = data["Street"] || nil address.number = data["Number"] || nil address.complement = data["Complement"] || nil address.zip_code = data["ZipCode"] || nil address.city = data["City"] || nil address.state = data["State"] || nil address.country = data["Country"] || nil end end |
Instance Method Details
#to_json(*options) ⇒ Object
20 21 22 23 24 |
# File 'lib/braspag/api/address.rb', line 20 def to_json(*) hash = as_json(*) hash.reject! {|k,v| v.nil?} hash.to_json(*) end |