Sha256: 33f71a6165ef10dda52dbef6ea472cc0a479dc96c7e1206732d42dc0a703afb6

Contents?: true

Size: 574 Bytes

Versions: 4

Compression:

Stored size: 574 Bytes

Contents

# frozen_string_literal: true

module ZephyrRuby
  # Connection provides the base functionality for interacting with APIs using
  # get, post, put, and delete operations.
  module Connection
    def get(path, params = {})
      request :get, path, params
    end

    def post(path, body)
      body = body.to_json if body.is_a?(Hash)
      request :post, path, body
    end

    def put(path, body)
      body = body.to_json if body.is_a?(Hash)
      request :put, path, body
    end

    def delete(path, params = {})
      request :delete, path, params
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
zephyr_ruby-0.4.0 lib/zephyr_ruby/connection.rb
zephyr_ruby-0.3.0 lib/zephyr_ruby/connection.rb
zephyr_ruby-0.2.0 lib/zephyr_ruby/connection.rb
zephyr_ruby-0.1.0 lib/zephyr_ruby/connection.rb