Sha256: fb4f069eb22eada73de3a8669defa7730c4ffa45791dd2fb02d8d8bcb1ae4801

Contents?: true

Size: 807 Bytes

Versions: 5

Compression:

Stored size: 807 Bytes

Contents

# frozen_string_literal: true

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

5 entries across 5 versions & 1 rubygems

Version Path
renstar-0.4.4 lib/renstar/api_client/query.rb
renstar-0.4.3 lib/renstar/api_client/query.rb
renstar-0.4.2 lib/renstar/api_client/query.rb
renstar-0.4.1 lib/renstar/api_client/query.rb
renstar-0.4.0 lib/renstar/api_client/query.rb