Sha256: fd41cba82b162ee715e31a27f3efd15051e7a1456816303e893461b523482e30

Contents?: true

Size: 561 Bytes

Versions: 12

Compression:

Stored size: 561 Bytes

Contents

require 'keen'

module Datapimp::Sources
  class Keen < Datapimp::Sources::Base
    attr_reader :options

    def initialize(args, options)
      @collection = args.first
      @options    = options.to_mash
    end

    def to_s
      extraction(@collection)
    end

    def extraction(event_collection)
      jsonify(client.extraction(event_collection))
    end

    private

    def client
      @_client ||= ::Keen::Client.new(
        project_id: Datapimp.config.keen_project_id,
        read_key:   Datapimp.config.keen_read_key
      )
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
datapimp-1.2.11 lib/datapimp/sources/keen.rb
datapimp-1.2.10 lib/datapimp/sources/keen.rb
datapimp-1.2.9 lib/datapimp/sources/keen.rb
datapimp-1.2.8 lib/datapimp/sources/keen.rb
datapimp-1.2.7 lib/datapimp/sources/keen.rb
datapimp-1.2.6 lib/datapimp/sources/keen.rb
datapimp-1.2.5 lib/datapimp/sources/keen.rb
datapimp-1.2.4 lib/datapimp/sources/keen.rb
datapimp-1.2.3 lib/datapimp/sources/keen.rb
datapimp-1.2.2 lib/datapimp/sources/keen.rb
datapimp-1.2.1 lib/datapimp/sources/keen.rb
datapimp-1.2.0 lib/datapimp/sources/keen.rb