Class: MM::Command::User

Inherits:
AbstractCommand show all
Defined in:
lib/mm/cmds/user.rb

Instance Method Summary collapse

Methods inherited from AbstractCommand

#cache_options, #card_property?, #display_value, #options, #output, #run, #user_property?, #view

Instance Method Details

#do_onceObject



19
20
21
22
23
# File 'lib/mm/cmds/user.rb', line 19

def do_once
  output "user        => #{options[:user]}"
  identifier = options[:user].to_s.downcase
  team_members.select {|user| user.id.to_s.downcase == options[:user] || user..to_s.downcase == options[:user]}
end

#docObject



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/mm/cmds/user.rb', line 29

def doc
%{
usage: mm user [login/user id]

Environment variable options:
  MM_USER => user id/login used to find the user info

Synopsis:
  mm user 'login' => find team member info by login
  mm user id => find team member info by id
}
end

#parse(argv) ⇒ Object



25
26
27
# File 'lib/mm/cmds/user.rb', line 25

def parse(argv)
  options[:user] = argv.join(' ').strip
end