Class: Break::Pry::Frontend
- Inherits:
-
Object
- Object
- Break::Pry::Frontend
- Defined in:
- lib/break/pry/frontend.rb
Instance Method Summary collapse
- #attach(session) ⇒ Object
- #detach ⇒ Object
-
#initialize(pry) ⇒ Frontend
constructor
A new instance of Frontend.
- #notify(message) ⇒ Object
- #where ⇒ Object
Constructor Details
#initialize(pry) ⇒ Frontend
Returns a new instance of Frontend.
5 6 7 |
# File 'lib/break/pry/frontend.rb', line 5 def initialize(pry) @pry = pry end |
Instance Method Details
#attach(session) ⇒ Object
9 10 11 12 |
# File 'lib/break/pry/frontend.rb', line 9 def attach(session) @pry = Pry.start(session.context.binding) where end |
#detach ⇒ Object
14 15 16 |
# File 'lib/break/pry/frontend.rb', line 14 def detach throw :breakout end |
#notify(message) ⇒ Object
24 25 26 |
# File 'lib/break/pry/frontend.rb', line 24 def notify() puts end |
#where ⇒ Object
18 19 20 21 22 |
# File 'lib/break/pry/frontend.rb', line 18 def where @pry&.run_command "whereami".dup rescue MethodSource::SourceNotFoundError puts "Cannot find method code." end |