Class: EventMachine::Kannel::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/em-kannel/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(http, start = nil) ⇒ Response

Returns a new instance of Response.



6
7
8
9
# File 'lib/em-kannel/response.rb', line 6

def initialize(http, start=nil)
  @http     = http
  @duration = compute_duration(start)
end

Instance Attribute Details

#durationObject (readonly)

Returns the value of attribute duration.



4
5
6
# File 'lib/em-kannel/response.rb', line 4

def duration
  @duration
end

Instance Method Details

#bodyObject



19
20
21
# File 'lib/em-kannel/response.rb', line 19

def body
  @http.response
end

#errorObject



23
24
25
# File 'lib/em-kannel/response.rb', line 23

def error
  @http.error
end

#guidObject



27
28
29
# File 'lib/em-kannel/response.rb', line 27

def guid
  body.split(": ").last
end

#statusObject



11
12
13
# File 'lib/em-kannel/response.rb', line 11

def status
  @http.response_header.status.to_i
end

#success?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/em-kannel/response.rb', line 15

def success?
  status == 202
end