Class: FireEagle::Response

Inherits:
Object
  • Object
show all
Includes:
HappyMapper
Defined in:
lib/fireeagle/response.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.parse(xml, opts = {}) ⇒ Object

Raises:



12
13
14
15
16
17
18
# File 'lib/fireeagle/response.rb', line 12

def self.parse(xml, opts = {})
  rsp = super(xml, opts)

  raise FireEagleException, rsp.error.message if rsp.fail?

  rsp
end

Instance Method Details

#fail?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/fireeagle/response.rb', line 20

def fail?
  status == "fail"
end

#success?Boolean

does the response indicate success?

Returns:

  • (Boolean)


25
26
27
# File 'lib/fireeagle/response.rb', line 25

def success?
  status == "ok"
end

#userObject



29
30
31
# File 'lib/fireeagle/response.rb', line 29

def user
  users[0]
end