Class: GithubCLI::Commands::Notifications
- Inherits:
-
GithubCLI::Command
- Object
- Thor
- GithubCLI::Command
- GithubCLI::Commands::Notifications
- Defined in:
- lib/github_cli/commands/notifications.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::MANPAGES, Thor::THOR_RESERVED_WORDS, Thor::Task, Thor::UndefinedTaskError, Thor::VERSION
Instance Attribute Summary
Attributes included from Thor::Actions
Attributes included from Thor::Base
#args, #options, #parent_options
Instance Method Summary collapse
- #check(id) ⇒ Object
- #create(id) ⇒ Object
- #delete(id) ⇒ Object
- #get(id) ⇒ Object
- #list ⇒ Object
- #mark ⇒ Object
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
#check(id) ⇒ Object
58 59 60 61 62 63 |
# File 'lib/github_cli/commands/notifications.rb', line 58 def check(id) = .dup params = [:params].dup Util.hash_without!(, params.keys + ['params']) Notification.subscribed? id, params, end |
#create(id) ⇒ Object
75 76 77 78 79 80 81 82 |
# File 'lib/github_cli/commands/notifications.rb', line 75 def create(id) = .dup params = [:params].dup params['subscribed'] = [:subscribed] if [:subscrirbed] params['ignored'] = [:ignored] if [:ignored] Util.hash_without!(, params.keys + ['params']) Notification.create id, params, end |
#delete(id) ⇒ Object
85 86 87 88 89 90 |
# File 'lib/github_cli/commands/notifications.rb', line 85 def delete(id) = .dup params = [:params].dup Util.hash_without!(, params.keys + ['params']) Notification.delete id, params, end |
#get(id) ⇒ Object
34 35 36 37 38 39 |
# File 'lib/github_cli/commands/notifications.rb', line 34 def get(id) = .dup params = [:params].dup Util.hash_without!(, params.keys + ['params']) Notification.get id, params, end |
#list ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/github_cli/commands/notifications.rb', line 24 def list = .dup params = [:params].dup params['user'] = [:user] if [:user] params['repo'] = [:repo] if [:repo] Util.hash_without!(, params.keys + ['params']) Notification.all params, end |
#mark ⇒ Object
46 47 48 49 50 51 52 53 54 55 |
# File 'lib/github_cli/commands/notifications.rb', line 46 def mark = .dup params = [:params].dup params['user'] = [:user] if [:user] params['repo'] = [:repo] if [:repo] params['read'] = [:read] if [:read] params['thread_id'] = [:id] if [:id] Util.hash_without!(, params.keys + ['params', 'id']) Notification.mark params, end |