Class: Sipgate::Response
- Inherits:
-
Object
- Object
- Sipgate::Response
- Defined in:
- lib/response.rb
Constant Summary collapse
- CODE_SUCCESS =
200
Instance Method Summary collapse
-
#initialize(response) ⇒ Response
constructor
A new instance of Response.
-
#sending_status ⇒ Object
gibt den Status eines Fax-Versandes zurück.
- #session_id ⇒ Object
- #session_status ⇒ Object
- #status_code ⇒ Object
- #status_string ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(response) ⇒ Response
Returns a new instance of Response.
5 6 7 |
# File 'lib/response.rb', line 5 def initialize(response) @response = response end |
Instance Method Details
#sending_status ⇒ Object
gibt den Status eines Fax-Versandes zurück. Mögliche Antworten: :pending, :sent, :failed
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/response.rb', line 31 def sending_status case session_status when "sending", "queued" :pending when "sent" :sent when "error during submit", "failed" :failed else raise "Konnte keinen Status aus Antwort ermitteln: #{inspect}" end end |
#session_id ⇒ Object
13 14 15 |
# File 'lib/response.rb', line 13 def session_id @response[:session_id] end |
#session_status ⇒ Object
17 18 19 |
# File 'lib/response.rb', line 17 def session_status @response[:session_status] end |
#status_code ⇒ Object
21 22 23 |
# File 'lib/response.rb', line 21 def status_code @response[:status_code] end |
#status_string ⇒ Object
25 26 27 |
# File 'lib/response.rb', line 25 def status_string @response[:status_string] end |
#success? ⇒ Boolean
9 10 11 |
# File 'lib/response.rb', line 9 def success? status_code == CODE_SUCCESS end |