Class: Session::PopulateHistory

Inherits:
Base
  • Object
show all
Includes:
Setup::Store
Defined in:
lib/pry-byetypo/session/populate_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(binding) ⇒ PopulateHistory

Returns a new instance of PopulateHistory.



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

def initialize(binding)
  @binding = binding
end

Instance Attribute Details

#bindingObject (readonly)

Returns the value of attribute binding.



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

def binding
  @binding
end

Instance Method Details

#callObject



16
17
18
19
20
21
22
23
24
# File 'lib/pry-byetypo/session/populate_history.rb', line 16

def call
  return unless is_assignement_variables?

  store.transaction do
    store.abort unless variables_to_store

    store[pry_instance_uid].push(*variables_to_store)
  end
end