Class: Session::ClearHistory

Inherits:
Base
  • Object
show all
Includes:
Setup::Store
Defined in:
lib/pry-byetypo/session/clear_history.rb

Constant Summary

Constants included from Setup::Store

Setup::Store::DEFAULT_STORE_PATH, Setup::Store::SEVEN_DAYS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Setup::Store

#staled_store?, #store, #store_path

Methods inherited from Base

call, check

Constructor Details

#initialize(pry) ⇒ ClearHistory

Returns a new instance of ClearHistory.



12
13
14
# File 'lib/pry-byetypo/session/clear_history.rb', line 12

def initialize(pry)
  @pry = pry
end

Instance Attribute Details

#pryObject (readonly)

Returns the value of attribute pry.



10
11
12
# File 'lib/pry-byetypo/session/clear_history.rb', line 10

def pry
  @pry
end

Instance Method Details

#callObject



16
17
18
19
# File 'lib/pry-byetypo/session/clear_history.rb', line 16

def call
  pry_instance_to_remove = pry.push_initial_binding.join
  store.transaction { store.delete(pry_instance_to_remove) }
end