Class: CRUDtree::Master

Inherits:
Object
  • Object
show all
Defined in:
lib/crudtree/tree/master.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ Master

Use :rango => true if you’re using rango



5
6
7
8
# File 'lib/crudtree/tree/master.rb', line 5

def initialize(params = {})
  @nodes = []
  @params = {dispatcher: :dispatcher}.merge(params)
end

Instance Attribute Details

#mappingObject

Returns the value of attribute mapping.



11
12
13
# File 'lib/crudtree/tree/master.rb', line 11

def mapping
  @mapping
end

#nodesObject (readonly) Also known as: subs

Returns the value of attribute nodes.



10
11
12
# File 'lib/crudtree/tree/master.rb', line 10

def nodes
  @nodes
end

#paramsObject

Returns the value of attribute params.



11
12
13
# File 'lib/crudtree/tree/master.rb', line 11

def params
  @params
end

Instance Method Details

#node(params, &block) ⇒ Object



15
16
17
18
# File 'lib/crudtree/tree/master.rb', line 15

def node(params, &block)
  @nodes << new_node = Node.new(self, params, &block)
  new_node
end