Sha256: 09013cdc5a799975c6a90e1bbea2e5902a03a765807ca87f507b6a00b8068388

Contents?: true

Size: 337 Bytes

Versions: 6

Compression:

Stored size: 337 Bytes

Contents

require 'json'

module Slate
  module Calculation
    class Base
      def initialize(graph)
        @graph = graph
      end

      def result
        nil # Override this
      end

      protected

      def data
        @data ||= JSON.parse(@graph.download(:json)).first["datapoints"].map(&:first).compact
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
slate-0.1.0 lib/slate/calculation.rb
slate-0.0.5 lib/slate/calculation.rb
slate-0.0.4 lib/slate/calculation.rb
slate-0.0.3 lib/slate/calculation.rb
slate-0.0.2 lib/slate/calculation.rb
slate-0.0.1 lib/slate/calculation.rb