Class: PiholeApi::Client
- Inherits:
-
Object
- Object
- PiholeApi::Client
- Includes:
- AuthorisedEndpoints, Constants, UnauthorisedEndpoints
- Defined in:
- lib/pihole-api/client.rb
Constant Summary
Constants included from Constants
PiholeApi::Constants::API_PATH
Instance Attribute Summary collapse
-
#api_token ⇒ Object
readonly
Returns the value of attribute api_token.
-
#base_path ⇒ Object
readonly
Returns the value of attribute base_path.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
Class Method Summary collapse
-
.api_version ⇒ Object
This is the version of the API docs this client was built off-of.
- .compatible_api_version ⇒ Object
Instance Method Summary collapse
-
#initialize(base_path:, api_token:, port: 80) ⇒ Client
constructor
A new instance of Client.
Methods included from AuthorisedEndpoints
#disable, #enable, #get_all_queries, #get_forward_destinations, #get_query_sources, #get_query_types, #over_time_data_10_mins, #recent_blocked, #summary, #summary_raw, #top_clients, #top_items
Methods included from UnauthorisedEndpoints
Constructor Details
#initialize(base_path:, api_token:, port: 80) ⇒ Client
Returns a new instance of Client.
11 12 13 14 15 |
# File 'lib/pihole-api/client.rb', line 11 def initialize(base_path:, api_token:, port: 80) @api_token = api_token @base_path = base_path @port = port end |
Instance Attribute Details
#api_token ⇒ Object (readonly)
Returns the value of attribute api_token.
9 10 11 |
# File 'lib/pihole-api/client.rb', line 9 def api_token @api_token end |
#base_path ⇒ Object (readonly)
Returns the value of attribute base_path.
9 10 11 |
# File 'lib/pihole-api/client.rb', line 9 def base_path @base_path end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
9 10 11 |
# File 'lib/pihole-api/client.rb', line 9 def port @port end |
Class Method Details
.api_version ⇒ Object
This is the version of the API docs this client was built off-of
22 23 24 |
# File 'lib/pihole-api/client.rb', line 22 def self.api_version 'v2 2023-01-21' end |
.compatible_api_version ⇒ Object
17 18 19 |
# File 'lib/pihole-api/client.rb', line 17 def self.compatible_api_version 'v3' end |