Class: PullReview::Coverage::ClientApi

Inherits:
Object
  • Object
show all
Defined in:
lib/pullreview/coverage/client_api.rb

Overview

Remote api based implementation for production intent

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ ClientApi

Returns a new instance of ClientApi.



29
30
31
# File 'lib/pullreview/coverage/client_api.rb', line 29

def initialize(config)
  @config = config || Config.new
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



27
28
29
# File 'lib/pullreview/coverage/client_api.rb', line 27

def config
  @config
end

Instance Method Details

#publish(payload) ⇒ Object

post json payload to pullreview host.



34
35
36
37
38
39
# File 'lib/pullreview/coverage/client_api.rb', line 34

def publish(payload)
  allow_pullreview_webmock
  allow_pullreview_vcr
  response = post(payload)
  "#{response.code} : #{response.body}"
end