Class: Pingdom::Cli::CLI
- Inherits:
-
Thor
- Object
- Thor
- Pingdom::Cli::CLI
- Includes:
- Thor::Actions
- Defined in:
- lib/pingdom/cli/cli.rb
Instance Method Summary collapse
- #actions ⇒ Object
- #checks ⇒ Object
- #config ⇒ Object
- #contacts ⇒ Object
- #credits ⇒ Object
-
#initialize(args = [], options = {}, config = {}) ⇒ CLI
constructor
A new instance of CLI.
- #pause ⇒ Object
- #probes ⇒ Object
- #reference ⇒ Object
- #reports_public ⇒ Object
- #settings ⇒ Object
- #unpause ⇒ Object
- #update ⇒ Object
Constructor Details
#initialize(args = [], options = {}, config = {}) ⇒ CLI
Returns a new instance of CLI.
13 14 15 16 17 18 |
# File 'lib/pingdom/cli/cli.rb', line 13 def initialize(args = [], = {}, config = {}) super(args, , config) @global_options = config[:shell].base. @config = YAML.load_file(@global_options['config']) @core = Core.new(@config) end |
Instance Method Details
#actions ⇒ Object
31 32 33 |
# File 'lib/pingdom/cli/cli.rb', line 31 def actions puts_json @core.actions end |
#checks ⇒ Object
26 27 28 |
# File 'lib/pingdom/cli/cli.rb', line 26 def checks puts_json @core.checks end |
#config ⇒ Object
21 22 23 |
# File 'lib/pingdom/cli/cli.rb', line 21 def config puts_json @config end |
#contacts ⇒ Object
36 37 38 |
# File 'lib/pingdom/cli/cli.rb', line 36 def contacts puts_json @core.contacts end |
#credits ⇒ Object
61 62 63 |
# File 'lib/pingdom/cli/cli.rb', line 61 def credits puts_json @core.credits end |
#pause ⇒ Object
66 67 68 |
# File 'lib/pingdom/cli/cli.rb', line 66 def pause puts @core.update({ paused: true }) end |
#probes ⇒ Object
41 42 43 |
# File 'lib/pingdom/cli/cli.rb', line 41 def probes puts_json @core.probes end |
#reference ⇒ Object
46 47 48 |
# File 'lib/pingdom/cli/cli.rb', line 46 def reference puts_json @core.reference end |
#reports_public ⇒ Object
51 52 53 |
# File 'lib/pingdom/cli/cli.rb', line 51 def reports_public puts_json @core.reports_public end |
#settings ⇒ Object
56 57 58 |
# File 'lib/pingdom/cli/cli.rb', line 56 def settings puts_json @core.settings end |
#unpause ⇒ Object
71 72 73 |
# File 'lib/pingdom/cli/cli.rb', line 71 def unpause puts @core.update({ paused: false }) end |
#update ⇒ Object
77 78 79 |
# File 'lib/pingdom/cli/cli.rb', line 77 def update puts @core.update(['params']) end |