Class: Fluffy::Session::Services
- Inherits:
-
Object
- Object
- Fluffy::Session::Services
- Includes:
- API
- Defined in:
- lib/fluffy/session/services.rb
Instance Attribute Summary collapse
-
#endpoint ⇒ String
readonly
The session endpoint.
Instance Method Summary collapse
-
#add(name:, **params) ⇒ Hash?
Add a new entry in the session services.
-
#delete(name:) ⇒ Hash?
Delete an entry from the session services.
-
#get ⇒ Hash
Retrieve the session services.
-
#initialize(endpoint:) ⇒ Services
constructor
Create a services instance for a given session.
-
#update(name:, **params) ⇒ Hash?
Update an existing entry in the session services.
Methods included from API
Constructor Details
#initialize(endpoint:) ⇒ Services
Create a services instance for a given session
13 14 15 |
# File 'lib/fluffy/session/services.rb', line 13 def initialize(endpoint:) @endpoint = endpoint + ['services'] end |
Instance Attribute Details
#endpoint ⇒ String (readonly)
Returns The session endpoint.
7 8 9 |
# File 'lib/fluffy/session/services.rb', line 7 def endpoint @endpoint end |
Instance Method Details
#add(name:, **params) ⇒ Hash?
Add a new entry in the session services
31 32 33 |
# File 'lib/fluffy/session/services.rb', line 31 def add(name:, **params) @@api.post(endpoint: self.endpoint + [name], params: params) end |
#delete(name:) ⇒ Hash?
Delete an entry from the session services
50 51 52 |
# File 'lib/fluffy/session/services.rb', line 50 def delete(name:) @@api.delete(endpoint: self.endpoint + [name]) end |
#get ⇒ Hash
Retrieve the session services
21 22 23 |
# File 'lib/fluffy/session/services.rb', line 21 def get @@api.get(endpoint: self.endpoint) end |
#update(name:, **params) ⇒ Hash?
Update an existing entry in the session services
41 42 43 |
# File 'lib/fluffy/session/services.rb', line 41 def update(name:, **params) @@api.patch(endpoint: self.endpoint + [name], params: params) end |