Class: Postful::Order
- Inherits:
-
Object
- Object
- Postful::Order
- Includes:
- InstanceExecModule, Util
- Defined in:
- lib/postful/order.rb
Overview
Represent a Postful order.
Instance Attribute Summary collapse
-
#addressees ⇒ Object
readonly
Returns the value of attribute addressees.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#history ⇒ Object
readonly
Returns the value of attribute history.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#pages ⇒ Object
readonly
Returns the value of attribute pages.
-
#preview_url ⇒ Object
readonly
Returns the value of attribute preview_url.
-
#price ⇒ Object
readonly
Returns the value of attribute price.
-
#return_address ⇒ Object
readonly
Returns the value of attribute return_address.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#tag1 ⇒ Object
readonly
Returns the value of attribute tag1.
-
#tag2 ⇒ Object
readonly
Returns the value of attribute tag2.
-
#tag3 ⇒ Object
readonly
Returns the value of attribute tag3.
-
#warnings ⇒ Object
readonly
Returns the value of attribute warnings.
Instance Method Summary collapse
Methods included from InstanceExecModule
Instance Attribute Details
#addressees ⇒ Object (readonly)
Returns the value of attribute addressees.
20 21 22 |
# File 'lib/postful/order.rb', line 20 def addressees @addressees end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
23 24 25 |
# File 'lib/postful/order.rb', line 23 def errors @errors end |
#history ⇒ Object (readonly)
Returns the value of attribute history.
19 20 21 |
# File 'lib/postful/order.rb', line 19 def history @history end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
10 11 12 |
# File 'lib/postful/order.rb', line 10 def id @id end |
#pages ⇒ Object (readonly)
Returns the value of attribute pages.
13 14 15 |
# File 'lib/postful/order.rb', line 13 def pages @pages end |
#preview_url ⇒ Object (readonly)
Returns the value of attribute preview_url.
14 15 16 |
# File 'lib/postful/order.rb', line 14 def preview_url @preview_url end |
#price ⇒ Object (readonly)
Returns the value of attribute price.
15 16 17 |
# File 'lib/postful/order.rb', line 15 def price @price end |
#return_address ⇒ Object (readonly)
Returns the value of attribute return_address.
22 23 24 |
# File 'lib/postful/order.rb', line 22 def return_address @return_address end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
12 13 14 |
# File 'lib/postful/order.rb', line 12 def source @source end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
11 12 13 |
# File 'lib/postful/order.rb', line 11 def status @status end |
#tag1 ⇒ Object (readonly)
Returns the value of attribute tag1.
16 17 18 |
# File 'lib/postful/order.rb', line 16 def tag1 @tag1 end |
#tag2 ⇒ Object (readonly)
Returns the value of attribute tag2.
17 18 19 |
# File 'lib/postful/order.rb', line 17 def tag2 @tag2 end |
#tag3 ⇒ Object (readonly)
Returns the value of attribute tag3.
18 19 20 |
# File 'lib/postful/order.rb', line 18 def tag3 @tag3 end |
#warnings ⇒ Object (readonly)
Returns the value of attribute warnings.
21 22 23 |
# File 'lib/postful/order.rb', line 21 def warnings @warnings end |
Instance Method Details
#cancel ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/postful/order.rb', line 42 def cancel response = delete_request_on_path("/service/mail/#{id}", @email, @password) case response.code when "200" then build_from_response(response.body) when "422" then raise Postful::ValidationException, (response.body) else process_standard_responses(response) end end |
#preview ⇒ Object
27 28 29 30 |
# File 'lib/postful/order.rb', line 27 def preview url = URI.parse(preview_url) url.read end |
#refresh ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/postful/order.rb', line 32 def refresh response = get_request_on_path("/service/mail/#{id}", @email, @password) case response.code when "200" then build_from_response(response.body) else process_standard_responses(response) end end |