Class: ErroneousAPI::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/erroneous-api/client.rb

Defined Under Namespace

Classes: Response

Instance Method Summary collapse

Constructor Details

#initialize(base_url) ⇒ Client

Returns a new instance of Client.



6
7
8
# File 'lib/erroneous-api/client.rb', line 6

def initialize(base_url)
  @base_url = base_url
end

Instance Method Details

#connectionObject



14
15
16
# File 'lib/erroneous-api/client.rb', line 14

def connection
  @connection ||= EY::ApiHMAC::BaseConnection.new
end

#mock!(backend) ⇒ Object



10
11
12
# File 'lib/erroneous-api/client.rb', line 10

def mock!(backend)
  self.connection.backend = backend
end

#parse_deploy_fail(text) ⇒ Object



18
19
20
21
22
# File 'lib/erroneous-api/client.rb', line 18

def parse_deploy_fail(text)
  connection.post(URI.join(@base_url, '/parse_deploy_fail').to_s, {:deploy_log => text}) do |json_response, location_header|
    Response.new(json_response)
  end
end