Class: Middleman::CoreExtensions::Collections::LazyCollectorRoot

Inherits:
BasicObject
Defined in:
lib/middleman-core/core_extensions/collections/lazy_root.rb

Instance Method Summary collapse

Constructor Details

#initialize(parent) ⇒ LazyCollectorRoot

Returns a new instance of LazyCollectorRoot.



7
8
9
10
# File 'lib/middleman-core/core_extensions/collections/lazy_root.rb', line 7

def initialize(parent)
  @data = nil
  @parent = parent
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



24
25
26
# File 'lib/middleman-core/core_extensions/collections/lazy_root.rb', line 24

def method_missing(name, *args, &block)
  LazyCollectorStep.new(name, args, block, self)
end

Instance Method Details

#leavesObject



20
21
22
# File 'lib/middleman-core/core_extensions/collections/lazy_root.rb', line 20

def leaves
  @parent.leaves
end

#realize!(data) ⇒ Object



12
13
14
# File 'lib/middleman-core/core_extensions/collections/lazy_root.rb', line 12

def realize!(data)
  @data = data
end

#value(_ctx = nil) ⇒ Object



16
17
18
# File 'lib/middleman-core/core_extensions/collections/lazy_root.rb', line 16

def value(_ctx=nil)
  @data
end