Sha256: cda93b9eadf756128f54bd9033c0b80f04559b8acd5805ba7dadd289a5f81777

Contents?: true

Size: 840 Bytes

Versions: 8

Compression:

Stored size: 840 Bytes

Contents

# frozen_string_literal: true

require_relative '../api_client'
require_relative 'api_objects/info'
require_relative 'api_objects/sensor'
require_relative 'api_objects/runtime'
require_relative 'api_objects/alert'
module Renstar
  module APIClient
    # Interface to the "Query" portion of the API
    # This can get general info, settings, runtime data, and alerts
    module Query
      def info
        Info.new(get('query/info'))
      end

      def sensors
        get('query/sensors')['sensors'].map do |sensor|
          Sensor.new(sensor)
        end
      end

      def runtimes
        get('query/runtimes')['runtimes'].map do |runtime|
          Runtime.new(runtime)
        end
      end

      def alerts
        get('query/alerts')['alerts'].map do |alert|
          Alert.new(alert)
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
renstar-0.3.1 lib/renstar/api_client/query.rb
renstar-0.3.0 lib/renstar/api_client/query.rb
renstar-0.2.1 lib/renstar/api_client/query.rb
renstar-0.2.0 lib/renstar/api_client/query.rb
renstar-0.1.3 lib/renstar/api_client/query.rb
renstar-0.1.2 lib/renstar/api_client/query.rb
renstar-0.1.1 lib/renstar/api_client/query.rb
renstar-0.1.0 lib/renstar/api_client/query.rb