Class: Pry
- Inherits:
-
Object
- Object
- Pry
- Defined in:
- lib/pry/hack.rb
Defined Under Namespace
Modules: Hackage
Class Method Summary collapse
-
.add_hack(type, handle, hack) ⇒ Pry::Hackage::Hack
Adds a hack to pry for use in the REPL.
-
.remove_hack(type, handle) ⇒ Fixnum
Removes a method from use in the REPL, added by Pry.add_hack.
Instance Method Summary collapse
Class Method Details
.add_hack(type, handle, hack) ⇒ Pry::Hackage::Hack
Adds a hack to pry for use in the REPL.
42 43 44 45 |
# File 'lib/pry/hack.rb', line 42 def self.add_hack(type, handle, hack) (eval "self.config.hack.s.#{self.config.hack.implications.send(:method_missing, type)||type}")[handle] = hack return hack end |
.remove_hack(type, handle) ⇒ Fixnum
Removes a method from use in the REPL, added by add_hack
53 54 55 56 57 |
# File 'lib/pry/hack.rb', line 53 def self.remove_hack(type, handle) si = self.config.hack.collect(&:size).reduce(0,:+) self.config.hack.each {|hash| hash.delete(handle)} return si - self.config.hack.collect(&:size).reduce(0,:+) end |
Instance Method Details
#old_retrieve_line ⇒ Object
218 |
# File 'lib/pry/hack.rb', line 218 alias_method :old_retrieve_line, :retrieve_line |