Class: GI::GIDSResponse

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from(response) ⇒ GI::GIDSResponse

Builds a response with a ok status and a response’s body

Parameters:

  • response

    returned from the rest call

Returns:



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

def self.from(response)
  GIDSResponse.new(status: response.status, body: response.body)
end

Instance Method Details

#bodyHash

Returns the response body.

Returns:

  • (Hash)

    the response body



11
# File 'lib/gi/gids_response.rb', line 11

attribute :body, Hash

#cache?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/gi/gids_response.rb', line 21

def cache?
  @status == 200
end

#statusInteger

Returns the response status.

Returns:

  • (Integer)

    the response status



8
# File 'lib/gi/gids_response.rb', line 8

attribute :status, Integer