Module: MongoTree::Strategies::FullTreeNode

Includes:
Base
Defined in:
lib/mongo_tree/strategies/full_tree_node.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/mongo_tree/strategies/full_tree_node.rb', line 6

def self.included(base)
  base.class_eval do
    class << self
      attr_accessor :mongo_tree_options
    end
    
    @mongo_tree_options = {
      :root => "#{self.name}".sub(/Node/, '')
    }.merge(@mongo_tree_options)
    
    many :children, :class_name => self.name
  end
  
  base.extend ClassMethods
  base.send :include, InstanceMethods
end