Class: Ribose::User

Inherits:
Base
  • Object
show all
Includes:
Actions::Create
Defined in:
lib/ribose/user.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Actions::Base

#included

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

.activate(email:, password:, otp:, **attributes) ⇒ Sawyer::Resoruce

Activate a user

Parameters:

  • email (String)

    The registering user email

  • password (String)

    A strong password for login

  • otp (String)

    The OTP received via the email

  • attributes (Hash)

    The other attributes as Hash.

Returns:

  • (Sawyer::Resoruce)

    The newly activated user



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

def self.activate(email:, password:, otp:, **attributes)
  new(attributes.merge(email: email, password: password, otp: otp)).activate
end

Instance Method Details

#activateObject



9
10
11
12
13
14
# File 'lib/ribose/user.rb', line 9

def activate
  Ribose::Request.post(
    "signup.user",
    custom_option.merge(user: attributes, auth_header: false),
  )
end

#createObject



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

def create
  create_resource
end