Module: RunCommand::ClassMethods
- Defined in:
- lib/city_watch/util/run_command.rb
Instance Method Summary collapse
- #command(cmd, opts = {}) ⇒ Object
- #data ⇒ Object
- #grep(str) ⇒ Object
- #options ⇒ Object
- #set_opts(opts = {}) ⇒ Object
Instance Method Details
#command(cmd, opts = {}) ⇒ Object
66 67 68 69 |
# File 'lib/city_watch/util/run_command.rb', line 66 def command(cmd,opts={}) [:command] = cmd set_opts opts end |
#data ⇒ Object
75 76 77 |
# File 'lib/city_watch/util/run_command.rb', line 75 def data new.data end |
#grep(str) ⇒ Object
71 72 73 |
# File 'lib/city_watch/util/run_command.rb', line 71 def grep(str) [:grep] = str end |
#options ⇒ Object
62 63 64 |
# File 'lib/city_watch/util/run_command.rb', line 62 def @opts ||= {} end |
#set_opts(opts = {}) ⇒ Object
57 58 59 60 |
# File 'lib/city_watch/util/run_command.rb', line 57 def set_opts(opts={}) @opts = .merge(opts) @command = nil end |