Class: PryToggle::Exec
- Inherits:
-
Object
- Object
- PryToggle::Exec
- Defined in:
- lib/pry_toggle/exec.rb
Instance Method Summary collapse
- #executable? ⇒ Boolean
- #execute! ⇒ Object
-
#initialize(args) ⇒ Exec
constructor
A new instance of Exec.
Constructor Details
#initialize(args) ⇒ Exec
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/pry_toggle/exec.rb', line 5 def initialize(args) if args.first =~ /\A(.+):(\d+?)\z/ @service = PryToggle::Service.new($1, $2.to_i, '', "binding.pry\n") else puts <<-DOC === Format should be === $ pry-tgl exmain.rb:10 OR $ pry-tgl exmain.rb#method_name DOC end end |
Instance Method Details
#executable? ⇒ Boolean
24 25 26 |
# File 'lib/pry_toggle/exec.rb', line 24 def executable? !!@service end |
#execute! ⇒ Object
20 21 22 |
# File 'lib/pry_toggle/exec.rb', line 20 def execute! @service.execute end |