Class: GithubCLI::Commands::Users

Inherits:
GithubCLI::Command show all
Defined in:
lib/github_cli/commands/users.rb

Constant Summary

Constants inherited from GithubCLI::Command

GithubCLI::Command::ALIASES, GithubCLI::Command::HELP_COMMAND

Constants inherited from Thor

Thor::DynamicTask, Thor::HELP_MAPPINGS, Thor::HiddenTask, Thor::THOR_RESERVED_WORDS, Thor::Task, Thor::UndefinedTaskError, Thor::VERSION

Instance Attribute Summary

Attributes included from Thor::Actions

#behavior

Attributes included from Thor::Base

#args, #options, #parent_options

Instance Method Summary collapse

Methods inherited from GithubCLI::Command

all, command_to_show, extract_namespace, is_api_command?, output_formats

Methods included from Thor::Actions

#action, #append_to_file, #apply, #chmod, #comment_lines, #copy_file, #create_file, #create_link, #destination_root, #destination_root=, #directory, #empty_directory, #find_in_source_paths, #gsub_file, #in_root, included, #initialize, #inject_into_class, #insert_into_file, #inside, #link_file, #prepend_to_file, #relative_to_original_destination_root, #remove_file, #run, #run_ruby_script, #source_paths, #template, #thor, #uncomment_lines

Methods inherited from Thor

check_unknown_options!, check_unknown_options?, command_help, default_command, desc, global_flags, handle_no_task_error, help, #help, long_desc, map, method_option, method_options, package_name, printable_commands, register, stop_on_unknown_option!, stop_on_unknown_option?, subcommand, subcommands

Methods included from Thor::Base

included, #initialize, register_klass_file, shell, shell=, subclass_files, subclasses

Instance Method Details

#getObject


23
24
25
26
27
28
29
# File 'lib/github_cli/commands/users.rb', line 23

def get
  global_options = options.dup
  params = options[:params].dup
  params['user'] = options[:user] if options[:user]
  Util.hash_without!(global_options, params.keys + ['params'])
  User.get params, global_options
end

#listObject


11
12
13
14
15
16
17
# File 'lib/github_cli/commands/users.rb', line 11

def list
  global_options = options.dup
  params = options[:params].dup
  params['since'] = options[:since] if options[:since]
  Util.hash_without!(global_options, params.keys + ['params'])
  User.all params, global_options
end

#updateObject


39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/github_cli/commands/users.rb', line 39

def update
  global_options = options.dup
  params = options[:params].dup
  params['name']     = options[:name]     if options[:name]
  params['email']    = options[:email]    if options[:email]
  params['blog']     = options[:blog]     if options[:blog]
  params['company']  = options[:company]  if options[:company]
  params['location'] = options[:location] if options[:location]
  params['hireable'] = options[:hireable] if options[:hireable]
  params['bio']      = options[:bio]      if options[:bio]
  Util.hash_without!(global_options, params.keys + ['params'])
  User.update params, global_options
end