Class: Slk::Commands::Debug

Inherits:
Base
  • Object
show all
Defined in:
lib/slk/commands/debug.rb

Overview

Hidden command for development spikes. Dumps raw JSON from Slack endpoints to validate xoxc compatibility and field shapes before building higher-level features.

Not registered in ‘slk help`.

Instance Attribute Summary

Attributes inherited from Base

#options, #positional_args, #runner

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Slk::Commands::Base

Instance Method Details

#dispatch_actionObject



21
22
23
24
25
26
27
28
29
# File 'lib/slk/commands/debug.rb', line 21

def dispatch_action
  case positional_args
  in ['profile', user] then dump_profile(user)
  in ['profile'] then dump_profile(nil)
  in ['team'] then dump_team
  in ['schema'] then dump_schema
  else unknown_action
  end
end

#executeObject



11
12
13
14
15
16
17
18
19
# File 'lib/slk/commands/debug.rb', line 11

def execute
  result = validate_options
  return result if result

  dispatch_action
rescue ApiError => e
  error("API error: #{e.message}")
  1
end