class Fluffy::Session::Addressbook
Attributes
endpoint[R]
@return [String] The session endpoint
Public Class Methods
new(endpoint:)
click to toggle source
Create an addressbook instance for a given session
@param endpoint [String] API
session endpoint
# File lib/fluffy/session/addressbook.rb, line 15 def initialize(endpoint:) @endpoint = endpoint + ['addressbook'] end
Public Instance Methods
add(name:, **params)
click to toggle source
Add a new entry in the session addressbook
@param name [String] Entry name @param **params [Hash] Any number of parameters to push into the Hash @return [Hash, nil] API
response
# File lib/fluffy/session/addressbook.rb, line 33 def add(name:, **params) @@api.post(endpoint: self.endpoint + [name], params: params) end
delete(name:)
click to toggle source
Delete an entry from the session addressbook
@param name [String] Entry name @return [Hash, nil] API
response
# File lib/fluffy/session/addressbook.rb, line 52 def delete(name:) @@api.delete(endpoint: self.endpoint + [name]) end
get()
click to toggle source
Retrieve the session addressbook
@return [Hash] The session addressbook
# File lib/fluffy/session/addressbook.rb, line 23 def get @@api.get(endpoint: self.endpoint) end
update(name:, **params)
click to toggle source
Update an existing entry in the session addressbook
@param name [String] Entry name @param **params [Hash] Any number of parameters to push into the Hash @return [Hash, nil] API
response
# File lib/fluffy/session/addressbook.rb, line 43 def update(name:, **params) @@api.patch(endpoint: self.endpoint + [name], params: params) end