Method: Hanami::Slice::ClassMethods#import
- Defined in:
- lib/hanami/slice.rb
#import(from: , as: nil, keys: nil) ⇒ Object
702 703 704 705 706 707 708 709 710 711 712 713 714 715 |
# File 'lib/hanami/slice.rb', line 702 def import(from:, **kwargs) slice = self container.after(:configure) do if from.is_a?(Symbol) || from.is_a?(String) slice_name = from from = slice.parent.slices[from.to_sym].container end as = kwargs[:as] || slice_name import(from: from, as: as, **kwargs) end end |