Sha256: 1a12d10458c79161388a54c654e23518826f217376ce0a1098b120b5568ee880

Contents?: true

Size: 725 Bytes

Versions: 2

Compression:

Stored size: 725 Bytes

Contents

# frozen_string_literal: true

module Mcoin
  module Market
    # :nodoc:
    class Bitstamp < Base
      ENDPOINT = 'https://www.bitstamp.net/api/v2/ticker/%<type>s%<currency>s/'

      def watch(type, currency)
        @pairs.add({ type: type.to_s.downcase, currency: currency.to_s.downcase })
      end

      private

      def build_ticker(pair, response)
        Data::Ticker.new(
          :Bitstamp,
          pair[:type].upcase, pair[:currency].upcase,
          last: response['last'],
          ask: response['ask'], bid: response['bid'],
          low: response['low'], high: response['high'],
          volume: response['volume'],
          timestamp: response['timestamp']
        )
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mcoin-0.6.1 lib/mcoin/market/bitstamp.rb
mcoin-0.6.0 lib/mcoin/market/bitstamp.rb