Sha256: 1ab67e48ef9c89fb59c569c4f67a2a281c979c776a142edbaa7e4d4e76af73ea

Contents?: true

Size: 771 Bytes

Versions: 1

Compression:

Stored size: 771 Bytes

Contents

module Base
  module Apis
    class Saving
      include HTTP
      attr_reader :client_secret

      def initialize(client_secret)
        @client_secret = client_secret
      end

      def request
        # https://github.com/baseinc/api-docs/blob/master/base_api_v1_savings.md
        #
        # { start_created: '2016-01-01',
        #   end_created:   '2016-01-10',
        #   limit:         20,
        #   offset:        0 }
        request_parameters = block_given? ? yield : {}

        uri =
          URI([
            API_HOST,
            "/#{API_VERSION}/savings?",
            URI.encode_www_form(request_parameters)].join)

        request = generate_request(uri, client_secret.header_parameter)
        start(request, uri)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
base-api-client-0.2.5.beta lib/base/apis/saving.rb