Method: LemonGraph::NodeMap#default_proc=

Defined in:
ext/lemongraph/node_map.cc

#default_proc=(proc) ⇒ Object

Sets the default proc for this node map.

If set, the default proc is called when a value is fetched for a node which was not assigned a value. The proc parameters must be the node key and the node map.

Set to nil to reset it so that the default value is returned when needed instead of calling the default proc.



792
793
794
795
796
797
# File 'ext/lemongraph/node_map.cc', line 792

VALUE lemongraph_nodemap_set_dflt_proc(VALUE self, VALUE proc)
{
  LemonGraph::NodeMap& nm = lemongraph_nodemap_rb2ref(self);
  nm.set_default_proc(proc);
  return self;
}