Class: SendGrid4r::CLI::User
- Inherits:
-
SgThor
- Object
- Thor
- SgThor
- SendGrid4r::CLI::User
show all
- Defined in:
- lib/sendgrid4r/cli/user.rb
Overview
Instance Method Summary
collapse
Methods inherited from SgThor
#initialize
Instance Method Details
#account(action) ⇒ Object
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/sendgrid4r/cli/user.rb', line 31
def account(action)
case action
when 'get'
puts @client.get_user_account
else
puts "error: #{action} is not supported in action parameter"
end
rescue RestClient::ExceptionWithResponse => e
puts e.inspect
end
|
#email(action) ⇒ Object
44
45
46
47
48
49
50
51
52
53
54
55
|
# File 'lib/sendgrid4r/cli/user.rb', line 44
def email(action)
case action
when 'get'
puts @client.get_user_email
when 'update'
puts @client.put_user_email(parameterise(options))
else
puts "error: #{action} is not supported in action parameter"
end
rescue RestClient::ExceptionWithResponse => e
puts e.inspect
end
|
#password(action) ⇒ Object
75
76
77
78
79
80
81
82
83
84
|
# File 'lib/sendgrid4r/cli/user.rb', line 75
def password(action)
case action
when 'update'
puts @client.put_user_password(parameterise(options))
else
puts "error: #{action} is not supported in action parameter"
end
rescue RestClient::ExceptionWithResponse => e
puts e.inspect
end
|
#profile(action) ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/sendgrid4r/cli/user.rb', line 17
def profile(action)
case action
when 'get'
puts @client.get_user_profile
when 'update'
puts @client.patch_user_profile(params: parameterise(options))
else
puts "error: #{action} is not supported in action parameter"
end
rescue RestClient::ExceptionWithResponse => e
puts e.inspect
end
|
#username(action) ⇒ Object
59
60
61
62
63
64
65
66
67
68
69
70
|
# File 'lib/sendgrid4r/cli/user.rb', line 59
def username(action)
case action
when 'get'
puts @client.get_user_username
when 'update'
puts @client.put_user_username(parameterise(options))
else
puts "error: #{action} is not supported in action parameter"
end
rescue RestClient::ExceptionWithResponse => e
puts e.inspect
end
|