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