Sha256: dd014af97c4514fdba871e67479246d80b7bed52e88f50e1f7088e096f773cb1

Contents?: true

Size: 515 Bytes

Versions: 25

Compression:

Stored size: 515 Bytes

Contents

require "json"

module Jess
  # Computer-related JSS API operations
  class Computers
    attr_reader :http_client

    def initialize(http_client)
      @http_client = http_client
    end

    # Retrieve a computer by ID.
    def find(id)
      json = JSON.parse(http_client.get("computers/id/#{id}"))
      Computer.new(json.fetch("computer"))
    end

    # Get all computer IDs.
    def all_ids
      json = JSON.parse(http_client.get("computers"))
      json["computers"].map { |c| c["id"] }
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
jess-1.4.1 lib/jess/computers.rb
jess-1.4.0 lib/jess/computers.rb
jess-1.3.2 lib/jess/computers.rb
jess-1.3.1 lib/jess/computers.rb
jess-1.3.0 lib/jess/computers.rb
jess-1.2.5 lib/jess/computers.rb
jess-1.2.4 lib/jess/computers.rb
jess-1.2.3 lib/jess/computers.rb
jess-1.2.2 lib/jess/computers.rb
jess-1.2.1 lib/jess/computers.rb
jess-1.2.0 lib/jess/computers.rb
jess-1.1.3 lib/jess/computers.rb
jess-1.1.2 lib/jess/computers.rb
jess-1.1.1 lib/jess/computers.rb
jess-1.1.0 lib/jess/computers.rb
jess-1.0.0 lib/jess/computers.rb
jess-0.10.1 lib/jess/computers.rb
jess-0.10.0 lib/jess/computers.rb
jess-0.9.0 lib/jess/computers.rb
jess-0.8.0 lib/jess/computers.rb