Class: PersevereResult

Inherits:
Object
  • Object
show all
Defined in:
lib/persevere.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.



24
25
26
27
28
29
# File 'lib/persevere.rb', line 24

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.



17
18
19
# File 'lib/persevere.rb', line 17

def body
  @body
end

#codeObject (readonly)

Returns the value of attribute code.



17
18
19
# File 'lib/persevere.rb', line 17

def code
  @code
end

#locationObject (readonly)

Returns the value of attribute location.



17
18
19
# File 'lib/persevere.rb', line 17

def location
  @location
end

#messageObject (readonly)

Returns the value of attribute message.



17
18
19
# File 'lib/persevere.rb', line 17

def message
  @message
end

Class Method Details

.make(response) ⇒ Object



19
20
21
22
# File 'lib/persevere.rb', line 19

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

Instance Method Details

#to_sObject



31
32
33
# File 'lib/persevere.rb', line 31

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