Class: PagSeguro::Shipping
- Inherits:
-
Object
- Object
- PagSeguro::Shipping
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/pag_seguro/shipping.rb
Constant Summary collapse
- PAC =
1
- SEDEX =
2
- UNIDENTIFIED =
3
Instance Attribute Summary collapse
-
#city ⇒ Object
Returns the value of attribute city.
-
#complement ⇒ Object
Returns the value of attribute complement.
-
#cost ⇒ Object
Returns the value of attribute cost.
-
#district ⇒ Object
Returns the value of attribute district.
-
#number ⇒ Object
Returns the value of attribute number.
-
#postal_code ⇒ Object
Returns the value of attribute postal_code.
-
#state ⇒ Object
Returns the value of attribute state.
-
#street ⇒ Object
Returns the value of attribute street.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Shipping
constructor
A new instance of Shipping.
- #pac? ⇒ Boolean
- #sedex? ⇒ Boolean
- #unidentified? ⇒ Boolean
Constructor Details
#initialize(attributes = {}) ⇒ Shipping
Returns a new instance of Shipping.
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/pag_seguro/shipping.rb', line 14 def initialize(attributes = {}) @type = attributes[:type] || UNIDENTIFIED @state = attributes[:state] @city = attributes[:city] @postal_code = attributes[:postal_code] @district = attributes[:district] @street = attributes[:street] @number = attributes[:number] @complement = attributes[:complement] @cost = attributes[:cost] end |
Instance Attribute Details
#city ⇒ Object
Returns the value of attribute city.
11 12 13 |
# File 'lib/pag_seguro/shipping.rb', line 11 def city @city end |
#complement ⇒ Object
Returns the value of attribute complement.
11 12 13 |
# File 'lib/pag_seguro/shipping.rb', line 11 def complement @complement end |
#cost ⇒ Object
Returns the value of attribute cost.
11 12 13 |
# File 'lib/pag_seguro/shipping.rb', line 11 def cost @cost end |
#district ⇒ Object
Returns the value of attribute district.
11 12 13 |
# File 'lib/pag_seguro/shipping.rb', line 11 def district @district end |
#number ⇒ Object
Returns the value of attribute number.
11 12 13 |
# File 'lib/pag_seguro/shipping.rb', line 11 def number @number end |
#postal_code ⇒ Object
Returns the value of attribute postal_code.
11 12 13 |
# File 'lib/pag_seguro/shipping.rb', line 11 def postal_code @postal_code end |
#state ⇒ Object
Returns the value of attribute state.
11 12 13 |
# File 'lib/pag_seguro/shipping.rb', line 11 def state @state end |
#street ⇒ Object
Returns the value of attribute street.
11 12 13 |
# File 'lib/pag_seguro/shipping.rb', line 11 def street @street end |
#type ⇒ Object
Returns the value of attribute type.
11 12 13 |
# File 'lib/pag_seguro/shipping.rb', line 11 def type @type end |
Instance Method Details
#sedex? ⇒ Boolean
38 39 40 |
# File 'lib/pag_seguro/shipping.rb', line 38 def sedex? SEDEX == type end |
#unidentified? ⇒ Boolean
42 43 44 |
# File 'lib/pag_seguro/shipping.rb', line 42 def unidentified? UNIDENTIFIED == type end |