Class: CouchTap::Destroyers::Collection
- Inherits:
-
Object
- Object
- CouchTap::Destroyers::Collection
- Defined in:
- lib/couch_tap/destroyers/collection.rb
Overview
Collection Destroyer. Go through each sub-table definition and remove all references to the parent document.
Instance Attribute Summary collapse
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(parent, opts = {}, &block) ⇒ Collection
constructor
A new instance of Collection.
-
#table(name, opts = {}, &block) ⇒ Object
DSL Methods.
Constructor Details
#initialize(parent, opts = {}, &block) ⇒ Collection
Returns a new instance of Collection.
14 15 16 17 18 19 |
# File 'lib/couch_tap/destroyers/collection.rb', line 14 def initialize(parent, opts = {}, &block) @_tables = [] @parent = parent instance_eval(&block) end |
Instance Attribute Details
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
12 13 14 |
# File 'lib/couch_tap/destroyers/collection.rb', line 12 def parent @parent end |
Instance Method Details
#execute ⇒ Object
21 22 23 24 25 26 |
# File 'lib/couch_tap/destroyers/collection.rb', line 21 def execute # Just go through each table and ask it to execute itself @_tables.each do |table| table.execute end end |