class Prof::PushedTestApp

Attributes

name[R]
url[R]

Public Class Methods

new(opts = {}) click to toggle source
# File lib/prof/pushed_test_app.rb, line 16
def initialize(opts = {})
  @name = opts.fetch(:name)
  @url  = opts.fetch(:url)
end

Public Instance Methods

read(key) click to toggle source
# File lib/prof/pushed_test_app.rb, line 27
def read(key)
  app_connection.get("/testdata/key/#{key}").body
end
write(key, value) click to toggle source
# File lib/prof/pushed_test_app.rb, line 23
def write(key, value)
  app_connection.put("/testdata/key/#{key}/value/#{value}")
end

Private Instance Methods

app_connection() click to toggle source
# File lib/prof/pushed_test_app.rb, line 33
def app_connection
  Faraday.new(url: url, ssl: { verify: false }) do |faraday|
    faraday.response :json, content_type: /\bjson$/
    faraday.adapter Faraday.default_adapter
  end
end