Class: Corraios::Delivery
- Inherits:
-
Object
- Object
- Corraios::Delivery
- Defined in:
- lib/corraios/delivery.rb
Instance Attribute Summary collapse
-
#amount_of_posts ⇒ Object
readonly
Returns the value of attribute amount_of_posts.
-
#deadline ⇒ Object
readonly
Returns the value of attribute deadline.
-
#error_message ⇒ Object
readonly
Returns the value of attribute error_message.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #error? ⇒ Boolean
-
#initialize(correios_response) ⇒ Delivery
constructor
A new instance of Delivery.
- #success? ⇒ Boolean
Constructor Details
#initialize(correios_response) ⇒ Delivery
Returns a new instance of Delivery.
8 9 10 11 |
# File 'lib/corraios/delivery.rb', line 8 def initialize(correios_response) @amount_of_posts = 1 parse_response(correios_response) end |
Instance Attribute Details
#amount_of_posts ⇒ Object (readonly)
Returns the value of attribute amount_of_posts.
6 7 8 |
# File 'lib/corraios/delivery.rb', line 6 def amount_of_posts @amount_of_posts end |
#deadline ⇒ Object (readonly)
Returns the value of attribute deadline.
4 5 6 |
# File 'lib/corraios/delivery.rb', line 4 def deadline @deadline end |
#error_message ⇒ Object (readonly)
Returns the value of attribute error_message.
4 5 6 |
# File 'lib/corraios/delivery.rb', line 4 def end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
4 5 6 |
# File 'lib/corraios/delivery.rb', line 4 def value @value end |
Instance Method Details
#error? ⇒ Boolean
13 14 15 |
# File 'lib/corraios/delivery.rb', line 13 def error? !! end |
#success? ⇒ Boolean
17 18 19 |
# File 'lib/corraios/delivery.rb', line 17 def success? !error? end |