Class: Hermetic::Transport::Http::Response

Inherits:
Struct
  • Object
show all
Defined in:
lib/hermetic/transport/http.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bodyObject

Returns the value of attribute body

Returns:

  • (Object)

    the current value of body



13
14
15
# File 'lib/hermetic/transport/http.rb', line 13

def body
  @body
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



13
14
15
# File 'lib/hermetic/transport/http.rb', line 13

def status
  @status
end

Instance Method Details

#jsonObject



14
# File 'lib/hermetic/transport/http.rb', line 14

def json = JSON.parse(body)

#success?Boolean

Returns:

  • (Boolean)


16
# File 'lib/hermetic/transport/http.rb', line 16

def success? = (200..299).cover?(status)