Class: DeployGate::Response

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

Instance Method Summary collapse

Constructor Details

#initialize(res) ⇒ Response

Returns a new instance of Response.



39
40
41
# File 'lib/deploygate/deploygate_client.rb', line 39

def initialize(res)
  @res = res
end

Instance Method Details

#[](name) ⇒ Object



55
56
57
# File 'lib/deploygate/deploygate_client.rb', line 55

def [](name)
  body[name]
end

#bodyObject



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

def body
  @body ||= JSON.parse(@res.body)
end

#resultsObject



51
52
53
# File 'lib/deploygate/deploygate_client.rb', line 51

def results
  @results ||= body['results']
end

#success?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/deploygate/deploygate_client.rb', line 43

def success?
  @res.code == '200'
end