Class: Dommy::Resources::Response

Inherits:
Struct
  • Object
show all
Defined in:
lib/dommy/resources.rb

Overview

A resolved resource. status_text is filled by whichever adapter built it (the Rack adapter uses Rack::Utils; the core adapters leave it blank or derive a minimal default) so the core stays Rails/Rack-independent.

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



20
21
22
# File 'lib/dommy/resources.rb', line 20

def body
  @body
end

#headersObject

Returns the value of attribute headers

Returns:

  • (Object)

    the current value of headers



20
21
22
# File 'lib/dommy/resources.rb', line 20

def headers
  @headers
end

#redirectedObject

Returns the value of attribute redirected

Returns:

  • (Object)

    the current value of redirected



20
21
22
# File 'lib/dommy/resources.rb', line 20

def redirected
  @redirected
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



20
21
22
# File 'lib/dommy/resources.rb', line 20

def status
  @status
end

#status_textObject

Returns the value of attribute status_text

Returns:

  • (Object)

    the current value of status_text



20
21
22
# File 'lib/dommy/resources.rb', line 20

def status_text
  @status_text
end

#urlObject

Returns the value of attribute url

Returns:

  • (Object)

    the current value of url



20
21
22
# File 'lib/dommy/resources.rb', line 20

def url
  @url
end

Instance Method Details

#success?Boolean

Returns:

  • (Boolean)


21
# File 'lib/dommy/resources.rb', line 21

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