Sha256: 52031527f9be27306d7eb6c2abe2fc26bf93fdea64151bc2ad204fed7c903674

Contents?: true

Size: 763 Bytes

Versions: 5

Compression:

Stored size: 763 Bytes

Contents

module KrakenClient
  module Endpoints
    class Public < Base

      def perform(endpoint_name, args)
        response = request_manager.call(url(endpoint_name), args)
        hash = Hashie::Mash.new(JSON.parse(response.body))
        hash[:result]
      end

      def data
        {
          :Time       => :server_time,
          :AssetPairs => :asset_pairs,
          :Depth      => :order_book,
          :Ticker     => :ticker,
          :Trades     => :trades,
          :Spread     => :spread,
          :Assets     => :assets,
        }
      end

      private

      def url(endpoint_name)
        @url = config.base_uri + '/' + config.api_version.to_s + '/public/' + endpoint_name
      end

      def raise_exception(*)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
kraken_client-1.1.5 lib/kraken_client/endpoints/public.rb
kraken_client-1.1.4 lib/kraken_client/endpoints/public.rb
kraken_client-1.1.3 lib/kraken_client/endpoints/public.rb
kraken_client-1.1.2 lib/kraken_client/endpoints/public.rb
kraken_client-1.1.1 lib/kraken_client/endpoints/public.rb