Module: ViewComponent::SlotableDefault
- Defined in:
- lib/view_component/slotable_default.rb
Instance Method Summary collapse
Instance Method Details
#get_slot(slot_name) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/view_component/slotable_default.rb', line 3 def get_slot(slot_name) @__vc_set_slots ||= {} return super unless !@__vc_set_slots[slot_name] && (default_method = registered_slots[slot_name][:default_method]) renderable_value = send(default_method) slot = Slot.new(self) if renderable_value.respond_to?(:render_in) slot.__vc_component_instance = renderable_value else slot.__vc_content = renderable_value end slot end |