Class: Comet::SlotBase

Inherits:
Class show all
Defined in:
lib/comet-html/parser-slot.rb

Direct Known Subclasses

Slot, SlotPlugin

Instance Attribute Summary

Attributes inherited from Class

#anchor_name, #bindings, #children, #el, #event_listeners, #inline_code, #parent, #refs, #repeaters, #slot_plugins, #slots, #superclass, #typename

Instance Method Summary collapse

Methods inherited from Class

#blocks_remote_references?, #collect_children, #constructor_decl, #find_class_for, #find_reference_for, #implements_ibindable_view?, #initialize, #is_anchorable?, #is_root?, #probe, #probe_bindings, #probe_bindings_for, #probe_references, #probe_slots_plugins, #probe_subtypes, #recursively_collect_children, #root, #should_skip?

Methods inherited from Context

#context, element_base_type, find_cpp_type, generate_new_ref_name, has_cpp_type?, load_global_element_types, reset, template_base_subtype, template_base_type, use_cpp_type

Constructor Details

This class inherits a constructor from Comet::Class

Instance Method Details

#create_reference(el, mode) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/comet-html/parser-slot.rb', line 14

def create_reference el, mode
  ref_root = nil 
  if (mode == :implicit) || (ref_root = find_remote_reference_holder).nil?
    super el, mode
  else
    ref_root.refs << Reference.new(el, ref_root, mode)
    @refs << RemoteReference.new(el, self, mode)
  end
end

#find_remote_reference_holderObject



5
6
7
8
9
10
11
12
# File 'lib/comet-html/parser-slot.rb', line 5

def find_remote_reference_holder
  p = @parent
  until p.is_root?
    return nil if p.blocks_remote_references?
    p = p.parent
  end
  p
end