class PiHole::Endpoint
The main entrypoint for this SDK. Describes the location and interaction with the PiHole
API
Attributes
api_key[R]
location[R]
Public Class Methods
new(location:, api_key:)
click to toggle source
Public Instance Methods
execute(command)
click to toggle source
@param [#query_string] command
# File lib/pi_hole/endpoint.rb, line 16 def execute(command) uri = URI "#{location}/admin/api.php?#{command.query_string}&#{auth_query_string}" Net::HTTP.get_response uri end
Private Instance Methods
auth_query_string()
click to toggle source
# File lib/pi_hole/endpoint.rb, line 25 def auth_query_string "auth=#{api_key}" end