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.



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

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

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



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

def config
  @config
end

Instance Method Details

#publish(payload) ⇒ Object

post json payload to pullreview host.



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

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