Module: Croudia::API::Account

Included in:
Client
Defined in:
lib/croudia/api/account.rb

Instance Method Summary collapse

Instance Method Details

#update_cover_image(image, params = {}) ⇒ Croudia::User #update_cover_image(params = {}) ⇒ Croudia::User

Update cover image

Overloads:

  • #update_cover_image(image, params = {}) ⇒ Croudia::User

    Parameters:

    • image (File)

      New cover image

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

      Addtional query parameters

  • #update_cover_image(params = {}) ⇒ Croudia::User

    Parameters:

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

      Query parameters

    Options Hash (params):

    • :image (File)

      New cover image

Returns:

See Also:



43
44
45
46
47
# File 'lib/croudia/api/account.rb', line 43

def update_cover_image(image, params={})
  merge_file!(params, image, :image)
  resp = post('/account/update_cover_image.json', params)
  Croudia::User.new(resp)
end

#update_profile(params) ⇒ Croudia::User

Update profile

Parameters:

  • params (Hash)

    Additional query parameters

Options Hash (params):

  • :description (String)

    Bio of the user

  • :location (String)

    Geo location

  • :name (String)

    Name of the user

  • :url (String)

    URL

Returns:

See Also:



58
59
60
61
# File 'lib/croudia/api/account.rb', line 58

def update_profile(params)
  resp = post('/account/update_profile.json', params)
  Croudia::User.new(resp)
end

#update_profile_image(image, params = {}) ⇒ Croudia::User #update_profile_image(params = {}) ⇒ Croudia::User

Update profile image

Overloads:

  • #update_profile_image(image, params = {}) ⇒ Croudia::User

    Parameters:

    • image (File)

      New profile image

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

      Addtional query parameters

  • #update_profile_image(params = {}) ⇒ Croudia::User

    Parameters:

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

      Query parameters

    Options Hash (params):

    • :image (File)

      New profile image

Returns:

See Also:



27
28
29
30
31
# File 'lib/croudia/api/account.rb', line 27

def update_profile_image(image, params={})
  merge_file!(params, image, :image)
  resp = post('/account/update_profile_image.json', params)
  Croudia::User.new(resp)
end

#verify_credentials(params = {}) ⇒ Croudia::User Also known as: current_user

Retrieve the Authenticated User

Parameters:

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

    Additional query parameterss

Returns:

See Also:



11
12
13
14
# File 'lib/croudia/api/account.rb', line 11

def verify_credentials(params={})
  resp = get('/account/verify_credentials.json', params)
  Croudia::User.new(resp)
end