Module: ApiTester

Defined in:
lib/api_tester.rb,
lib/api_tester/version.rb,
lib/api_tester/connection.rb

Defined Under Namespace

Classes: Configuration, Connection

Constant Summary collapse

VERSION =
"0.0.5"

Class Method Summary collapse

Class Method Details

.configurationObject



14
15
16
# File 'lib/api_tester.rb', line 14

def self.configuration
  @configuration ||= Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:



18
19
20
# File 'lib/api_tester.rb', line 18

def self.configure
  yield(configuration) if block_given?
end

.connectionObject



28
29
30
# File 'lib/api_tester.rb', line 28

def self.connection
  @connection ||= Connection.new(configuration.endpoint, configuration.options)
end

.post(api, body, params = []) ⇒ Object



22
23
24
25
26
# File 'lib/api_tester.rb', line 22

def self.post(api, body, params = [])
  puts api
  resp = connection.post(api, body, params)
  connection.pretty_print(resp)
end