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

Inherits:
BasicObject
Defined in:
middleman-core/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 'middleman-core/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 'middleman-core/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 'middleman-core/lib/middleman-core/core_extensions/collections/lazy_root.rb', line 20

def leaves
  @parent.leaves
end

#realize!(data) ⇒ Object



12
13
14
# File 'middleman-core/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 'middleman-core/lib/middleman-core/core_extensions/collections/lazy_root.rb', line 16

def value(_ctx=nil)
  @data
end