Class: GitIam::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/git-iam/cli.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object

allows user to be set without special flags



37
38
39
40
# File 'lib/git-iam/cli.rb', line 37

def method_missing(method, *args)
  args.unshift(method.to_s)
  set_user_config args
end

Instance Method Details

#email(email) ⇒ Object



31
32
33
34
# File 'lib/git-iam/cli.rb', line 31

def email(email)
  GitIam::Iam.set_user_email email
  who
end

#resetObject



13
14
15
16
# File 'lib/git-iam/cli.rb', line 13

def reset
  GitIam::Iam.reset
  who
end

#set_user_config(args) ⇒ Object



19
20
21
22
# File 'lib/git-iam/cli.rb', line 19

def set_user_config(args)
  GitIam::Iam.set_user_config args
  who
end

#user(name) ⇒ Object



25
26
27
28
# File 'lib/git-iam/cli.rb', line 25

def user(name)
  GitIam::Iam.set_user_name name
  who
end

#whoObject



8
9
10
# File 'lib/git-iam/cli.rb', line 8

def who
  Helpers.print GitIam::Iam.who
end