Class: Celery::User

Inherits:
Object
  • Object
show all
Defined in:
lib/celery/resources/user.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api) ⇒ User

Returns a new instance of User.



5
6
7
# File 'lib/celery/resources/user.rb', line 5

def initialize(api)
  @api = api
end

Instance Attribute Details

#apiObject

Returns the value of attribute api.



3
4
5
# File 'lib/celery/resources/user.rb', line 3

def api
  @api
end

Instance Method Details

#meJSON

Retrieves seller information about yourself.

Examples:


profile = celery.user.me
profile["email"]
=> "[email protected]"

Returns:

  • (JSON)

    A User object.

See Also:



21
22
23
# File 'lib/celery/resources/user.rb', line 21

def me
  @api.get("users/me")
end

#update(user) ⇒ JSON

TODO: Need to get the arguments for this method. Updates seller information about yourself.

Examples:


profile = celery.user.update(email: '[email protected]')
profile["email"]
=> "[email protected]"

Parameters:

  • user (Hash)

    A hash of user attributes.

Returns:

  • (JSON)

    A User object.

See Also:



40
41
42
# File 'lib/celery/resources/user.rb', line 40

def update(user)
  @api.put("users/me", body: {user: user})
end