Class: Fluffy::Client
Instance Attribute Summary collapse
-
#sessions ⇒ Fluffy::Sessions
readonly
Sessions instance.
Instance Method Summary collapse
-
#addressbook ⇒ Hash
Retrieve the active addressbook.
-
#chains ⇒ Hash
Retrieve the active chains.
-
#initialize(url:, version: 1) ⇒ Client
constructor
Create a new client.
-
#interfaces ⇒ Hash
Retrieve the active interfaces.
-
#rules ⇒ Hash
Retrieve the active rules.
-
#services ⇒ Hash
Retrieve the active rollback checks.
Methods included from API
Constructor Details
#initialize(url:, version: 1) ⇒ Client
Create a new client
19 20 21 22 23 24 |
# File 'lib/fluffy/client.rb', line 19 def initialize(url:, version: 1) @url = url @version = version @@api = RESTClient.new(url: URI.join(url, "v#{version}")) @sessions = Sessions.new end |
Instance Attribute Details
#sessions ⇒ Fluffy::Sessions (readonly)
Returns Sessions instance.
12 13 14 |
# File 'lib/fluffy/client.rb', line 12 def sessions @sessions end |
Instance Method Details
#addressbook ⇒ Hash
Retrieve the active addressbook
30 31 32 |
# File 'lib/fluffy/client.rb', line 30 def addressbook @@api.get(endpoint: "addressbook") end |
#chains ⇒ Hash
Retrieve the active chains
46 47 48 |
# File 'lib/fluffy/client.rb', line 46 def chains @@api.get(endpoint: "chains") end |
#interfaces ⇒ Hash
Retrieve the active interfaces
54 55 56 |
# File 'lib/fluffy/client.rb', line 54 def interfaces @@api.get(endpoint: "interfaces") end |
#rules ⇒ Hash
Retrieve the active rules
38 39 40 |
# File 'lib/fluffy/client.rb', line 38 def rules @@api.get(endpoint: "rules") end |
#services ⇒ Hash
Retrieve the active rollback checks
62 63 64 |
# File 'lib/fluffy/client.rb', line 62 def services @@api.get(endpoint: "services") end |