Class: PersevereResult

Inherits:
Object
  • Object
show all
Defined in:
lib/persevere_client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(location, code, message, body) ⇒ PersevereResult

Returns a new instance of PersevereResult.



40
41
42
43
44
45
# File 'lib/persevere_client.rb', line 40

def initialize(location, code, message, body)
  @location = location
  @code = code
  @message = message
  @body = body
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



33
34
35
# File 'lib/persevere_client.rb', line 33

def body
  @body
end

#codeObject (readonly)

Returns the value of attribute code.



33
34
35
# File 'lib/persevere_client.rb', line 33

def code
  @code
end

#locationObject (readonly)

Returns the value of attribute location.



33
34
35
# File 'lib/persevere_client.rb', line 33

def location
  @location
end

#messageObject (readonly)

Returns the value of attribute message.



33
34
35
# File 'lib/persevere_client.rb', line 33

def message
  @message
end

Class Method Details

.make(response) ⇒ Object



35
36
37
38
# File 'lib/persevere_client.rb', line 35

def PersevereResult.make(response)
  return PersevereResult.new(response["Location"], response.code,
                             response.msg, response.body)
end

Instance Method Details

#to_sObject



47
48
49
# File 'lib/persevere_client.rb', line 47

def to_s
  super + " < Location: #{ @location } Code: #{ @code } Message: #{ @message } >"
end