Class: Jess::Computers
- Inherits:
-
Object
- Object
- Jess::Computers
- Defined in:
- lib/jess/computers.rb
Overview
Computer-related JSS API operations
Instance Attribute Summary collapse
-
#http_client ⇒ Object
readonly
Returns the value of attribute http_client.
Instance Method Summary collapse
-
#find(id) ⇒ Object
Retrieve a computer by ID.
-
#initialize(http_client) ⇒ Computers
constructor
A new instance of Computers.
Constructor Details
#initialize(http_client) ⇒ Computers
Returns a new instance of Computers.
8 9 10 |
# File 'lib/jess/computers.rb', line 8 def initialize(http_client) @http_client = http_client end |
Instance Attribute Details
#http_client ⇒ Object (readonly)
Returns the value of attribute http_client.
6 7 8 |
# File 'lib/jess/computers.rb', line 6 def http_client @http_client end |
Instance Method Details
#find(id) ⇒ Object
Retrieve a computer by ID.
13 14 15 16 |
# File 'lib/jess/computers.rb', line 13 def find(id) json = JSON.parse(http_client.get("computers/id/#{id}")) Computer.new(json.fetch("computer")) end |