Class: Ribose::Profile

Inherits:
Base
  • Object
show all
Includes:
Actions::Fetch, Actions::Update
Defined in:
lib/ribose/profile.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Actions::Update

#update

Methods included from Actions::Base

#included

Methods included from Actions::Fetch

#fetch

Methods inherited from Base

#initialize

Methods included from ResourceHelper

#resource_id, #resource_key, #resource_path, #resources

Constructor Details

This class inherits a constructor from Ribose::Base

Class Method Details

.fetch(options = {}) ⇒ Sawyer::Resource

Fetch user profile

Parameters:

  • options (Hash) (defaults to: {})

    The query parameters

Returns:

  • (Sawyer::Resource)

    The user profile



15
16
17
# File 'lib/ribose/profile.rb', line 15

def self.fetch(options = {})
  new(resource_id: nil, **options).fetch
end

.set_login(name, options = {}) ⇒ Sawyer::Resource

Set login name

Parameters:

  • login (String)

    The user login name

Returns:

  • (Sawyer::Resource)

    The user profile



33
34
35
# File 'lib/ribose/profile.rb', line 33

def self.(name, options = {})
  new(login: name, **options).
end

.update(attributes) ⇒ Sawyer::Resource

Update user profile

Parameters:

  • attributes (Hash)

    The new attributes

Returns:

  • (Sawyer::Resource)

    The user profile



24
25
26
# File 'lib/ribose/profile.rb', line 24

def self.update(attributes)
  new(resource_id: nil, **attributes).update
end

Instance Method Details

#set_loginObject



6
7
8
# File 'lib/ribose/profile.rb', line 6

def 
  [resource_key]
end