Class: Strobe::Account

Inherits:
Object
  • Object
show all
Defined in:
lib/strobe/account.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ Account

we don’t need the account for anything yet, so leave it



45
46
# File 'lib/strobe/account.rb', line 45

def initialize(json)
end

Class Method Details

.loginObject



35
36
37
38
39
40
41
42
# File 'lib/strobe/account.rb', line 35

def self.
  email, pass = 

  response = HTTP.new.(email, pass)
  persist_details(*response)

  Strobe.ui.info "You are now logged in as #{email}"
end

.signupObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/strobe/account.rb', line 20

def self.
  while true
    email, pass = 
    passc = Strobe.ui.password "Repeat Password: "
    break if pass == passc

    Strobe.ui.info "The password and confirmation do not match. Please try again."
  end

  response = HTTP.new.(email, pass)
  persist_details(*response)

  Strobe.ui.info "Your account was created successfully."
end

.signup_or_loginObject



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/strobe/account.rb', line 6

def self.
  Strobe.ui.info          "You aren't logged in with a Strobe user on this machine"
  Strobe.ui.info          "  1. Create a new Strobe user"
  Strobe.ui.info          "  2. Log in with an existing Strobe user"
  option = Strobe.ui.ask  "Please select an option: "

  case option
  when "1"
    
  when "2"
    
  end
end