Class: BulkOperations::BulkProxy
- Inherits:
-
Object
- Object
- BulkOperations::BulkProxy
- Defined in:
- lib/bulk_operations/proxy.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#proxied_object ⇒ Object
readonly
Returns the value of attribute proxied_object.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(object) ⇒ BulkProxy
constructor
A new instance of BulkProxy.
- #method_missing(name, *args, &block) ⇒ Object
Constructor Details
#initialize(object) ⇒ BulkProxy
Returns a new instance of BulkProxy.
8 9 10 11 |
# File 'lib/bulk_operations/proxy.rb', line 8 def initialize(object) @proxied_object = object @operation_stack = [] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
13 14 15 |
# File 'lib/bulk_operations/proxy.rb', line 13 def method_missing(name, *args, &block) @operation_stack << [name, *args, block] end |
Instance Attribute Details
#proxied_object ⇒ Object (readonly)
Returns the value of attribute proxied_object.
6 7 8 |
# File 'lib/bulk_operations/proxy.rb', line 6 def proxied_object @proxied_object end |
Instance Method Details
#execute ⇒ Object
17 18 19 20 |
# File 'lib/bulk_operations/proxy.rb', line 17 def execute raise OperationStackEmptyError if @operation_stack.empty? do_execute end |