Class: Pry::CommandState Private
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/pry-0.14.2/lib/pry/command_state.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
CommandState is a data structure to hold per-command state.
Pry commands can store arbitrary state here. This state persists between subsequent command invocations. All state saved here is unique to the command.
Class Method Summary collapse
- .default ⇒ Object private
Instance Method Summary collapse
-
#initialize ⇒ CommandState
constructor
private
A new instance of CommandState.
- #reset(command_name) ⇒ Object private
- #state_for(command_name) ⇒ Object private
Constructor Details
#initialize ⇒ CommandState
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of CommandState.
19 20 21 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/pry-0.14.2/lib/pry/command_state.rb', line 19 def initialize @command_state = {} end |
Class Method Details
.default ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
15 16 17 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/pry-0.14.2/lib/pry/command_state.rb', line 15 def self.default @default ||= new end |
Instance Method Details
#reset(command_name) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
27 28 29 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/pry-0.14.2/lib/pry/command_state.rb', line 27 def reset(command_name) @command_state[command_name] = OpenStruct.new end |
#state_for(command_name) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
23 24 25 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/pry-0.14.2/lib/pry/command_state.rb', line 23 def state_for(command_name) @command_state[command_name] ||= OpenStruct.new end |