Class: Gzr::Commands::Alert

Inherits:
Thor
  • Object
show all
Defined in:
lib/gzr/commands/alert.rb,
lib/gzr/commands/alert/ls.rb,
lib/gzr/commands/alert/cat.rb,
lib/gzr/commands/alert/read.rb,
lib/gzr/commands/alert/chown.rb,
lib/gzr/commands/alert/delete.rb,
lib/gzr/commands/alert/enable.rb,
lib/gzr/commands/alert/follow.rb,
lib/gzr/commands/alert/import.rb,
lib/gzr/commands/alert/disable.rb,
lib/gzr/commands/alert/unfollow.rb,
lib/gzr/commands/alert/randomize.rb,
lib/gzr/commands/alert/threshold.rb,
lib/gzr/commands/alert/notifications.rb

Defined Under Namespace

Classes: Cat, Chown, Delete, Disable, Enable, Follow, Import, Ls, Notifications, Randomize, Read, Threshold, Unfollow

Instance Method Summary collapse

Instance Method Details

#cat(alert_id) ⇒ Object



75
76
77
78
79
80
81
82
# File 'lib/gzr/commands/alert.rb', line 75

def cat(alert_id)
  if options[:help]
    invoke :help, ['cat']
  else
    require_relative 'alert/cat'
    Gzr::Commands::Alert::Cat.new(alert_id,options).execute
  end
end

#chown(alert_id, owner_id) ⇒ Object



159
160
161
162
163
164
165
166
# File 'lib/gzr/commands/alert.rb', line 159

def chown(alert_id, owner_id)
  if options[:help]
    invoke :help, ['chown']
  else
    require_relative 'alert/chown'
    Gzr::Commands::Alert::Chown.new(alert_id,owner_id,options).execute
  end
end

#disable(alert_id, reason) ⇒ Object



123
124
125
126
127
128
129
130
# File 'lib/gzr/commands/alert.rb', line 123

def disable(alert_id,reason)
  if options[:help]
    invoke :help, ['disable']
  else
    require_relative 'alert/disable'
    Gzr::Commands::Alert::Disable.new(alert_id,reason,options).execute
  end
end

#enable(alert_id) ⇒ Object



111
112
113
114
115
116
117
118
# File 'lib/gzr/commands/alert.rb', line 111

def enable(alert_id)
  if options[:help]
    invoke :help, ['enable']
  else
    require_relative 'alert/enable'
    Gzr::Commands::Alert::Enable.new(alert_id,options).execute
  end
end

#follow_alert(alert_id) ⇒ Object



87
88
89
90
91
92
93
94
# File 'lib/gzr/commands/alert.rb', line 87

def follow_alert(alert_id)
  if options[:help]
    invoke :help, ['follow']
  else
    require_relative 'alert/follow'
    Gzr::Commands::Alert::Follow.new(alert_id,options).execute
  end
end

#import(file, dashboard_element_id = nil) ⇒ Object



205
206
207
208
209
210
211
212
# File 'lib/gzr/commands/alert.rb', line 205

def import(file,dashboard_element_id=nil)
  if options[:help]
    invoke :help, ['import']
  else
    require_relative 'alert/import'
    Gzr::Commands::Alert::Import.new(file, dashboard_element_id, options).execute
  end
end

#lsObject



45
46
47
48
49
50
51
52
# File 'lib/gzr/commands/alert.rb', line 45

def ls(*)
  if options[:help]
    invoke :help, ['ls']
  else
    require_relative 'alert/ls'
    Gzr::Commands::Alert::Ls.new(options).execute
  end
end

#notificationsObject



175
176
177
178
179
180
181
182
# File 'lib/gzr/commands/alert.rb', line 175

def notifications(*)
  if options[:help]
    invoke :help, ['notifications']
  else
    require_relative 'alert/notifications'
    Gzr::Commands::Alert::Notifications.new(options).execute
  end
end

#randomize(alert_id = nil) ⇒ Object



61
62
63
64
65
66
67
68
# File 'lib/gzr/commands/alert.rb', line 61

def randomize(alert_id=nil)
  if options[:help]
    invoke :help, ['randomize']
  else
    require_relative 'alert/randomize'
    Gzr::Commands::Alert::Randomize.new(alert_id,options).execute
  end
end

#read(notification_id) ⇒ Object



191
192
193
194
195
196
197
198
# File 'lib/gzr/commands/alert.rb', line 191

def read(notification_id)
  if options[:help]
    invoke :help, ['read']
  else
    require_relative 'alert/read'
    Gzr::Commands::Alert::Read.new(notification_id,options).execute
  end
end

#rm(alert_id) ⇒ Object



147
148
149
150
151
152
153
154
# File 'lib/gzr/commands/alert.rb', line 147

def rm(alert_id)
  if options[:help]
    invoke :help, ['delete']
  else
    require_relative 'alert/delete'
    Gzr::Commands::Alert::Delete.new(alert_id,options).execute
  end
end

#threshold(alert_id, threshold) ⇒ Object



135
136
137
138
139
140
141
142
# File 'lib/gzr/commands/alert.rb', line 135

def threshold(alert_id,threshold)
  if options[:help]
    invoke :help, ['threshold']
  else
    require_relative 'alert/threshold'
    Gzr::Commands::Alert::Threshold.new(alert_id,threshold,options).execute
  end
end

#unfollow_alert(alert_id) ⇒ Object



99
100
101
102
103
104
105
106
# File 'lib/gzr/commands/alert.rb', line 99

def unfollow_alert(alert_id)
  if options[:help]
    invoke :help, ['unfollow']
  else
    require_relative 'alert/unfollow'
    Gzr::Commands::Alert::Unfollow.new(alert_id,options).execute
  end
end