Class: Commerce::BlockObject
- Inherits:
-
Object
- Object
- Commerce::BlockObject
- Defined in:
- lib/commerce.rb
Overview
Block object used for binding in dispatch blocks
Instance Method Summary collapse
-
#initialize ⇒ BlockObject
constructor
A new instance of BlockObject.
- #method_missing(method, *args, &block) ⇒ Object
- #procs ⇒ Object
Constructor Details
#initialize ⇒ BlockObject
Returns a new instance of BlockObject.
13 14 15 |
# File 'lib/commerce.rb', line 13 def initialize @procs = {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
21 22 23 24 25 |
# File 'lib/commerce.rb', line 21 def method_missing(method, *args, &block) raise CommerceError::CommerceError, "Missing dispatch block" unless block_given? @procs[method.to_sym] = block end |
Instance Method Details
#procs ⇒ Object
17 18 19 |
# File 'lib/commerce.rb', line 17 def procs @procs end |