Class: ActiveMocker::Mock::HashProcess Private
- Inherits:
-
Object
- Object
- ActiveMocker::Mock::HashProcess
- Defined in:
- lib/active_mocker/mock/hash_process.rb
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.
Instance Attribute Summary collapse
- #hash ⇒ Object private
- #processor ⇒ Object private
Instance Method Summary collapse
- #[](val) ⇒ Object private
-
#initialize(hash, processor) ⇒ HashProcess
constructor
private
A new instance of HashProcess.
Constructor Details
#initialize(hash, processor) ⇒ HashProcess
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 HashProcess.
8 9 10 11 12 |
# File 'lib/active_mocker/mock/hash_process.rb', line 8 def initialize(hash, processor) @hash = hash @processor = processor @hash_process = {} end |
Instance Attribute Details
#hash ⇒ 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.
6 7 8 |
# File 'lib/active_mocker/mock/hash_process.rb', line 6 def hash @hash end |
#processor ⇒ 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.
6 7 8 |
# File 'lib/active_mocker/mock/hash_process.rb', line 6 def processor @processor end |
Instance Method Details
#[](val) ⇒ 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.
14 15 16 |
# File 'lib/active_mocker/mock/hash_process.rb', line 14 def [](val) @hash_process[val] ||= processor.call(hash[val]) end |