Class: Analytical::CommandStore
- Inherits:
-
Object
- Object
- Analytical::CommandStore
- Defined in:
- lib/analytical/command_store.rb
Instance Attribute Summary collapse
-
#commands ⇒ Object
Returns the value of attribute commands.
Instance Method Summary collapse
- #flush ⇒ Object
-
#initialize(initial_list = nil) ⇒ CommandStore
constructor
A new instance of CommandStore.
-
#method_missing(method, *args, &block) ⇒ Object
Pass any array methods on to the internal array.
Constructor Details
#initialize(initial_list = nil) ⇒ CommandStore
Returns a new instance of CommandStore.
5 6 7 |
# File 'lib/analytical/command_store.rb', line 5 def initialize(initial_list=nil) @commands = initial_list || [] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
Pass any array methods on to the internal array
14 15 16 |
# File 'lib/analytical/command_store.rb', line 14 def method_missing(method, *args, &block) @commands.send(method, *args, &block) end |
Instance Attribute Details
#commands ⇒ Object
Returns the value of attribute commands.
3 4 5 |
# File 'lib/analytical/command_store.rb', line 3 def commands @commands end |
Instance Method Details
#flush ⇒ Object
9 10 11 |
# File 'lib/analytical/command_store.rb', line 9 def flush @commands = [] end |