Sha256: 36f70fca6a59c4051d677d2de0751f436e1695134b81f449c77a8de1a326f3e8

Contents?: true

Size: 341 Bytes

Versions: 2

Compression:

Stored size: 341 Bytes

Contents

# frozen_string_literal: true

module Lite
  module Component
    module ComponentHelper

      def component(name, attrs = nil, &block)
        name = name.component_path if name.respond_to?(:component_path)
        klass = "#{name}_component".classify.constantize.new(self, attrs, &block)
        klass.render
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lite-component-1.0.1 app/helpers/lite/component/component_helper.rb
lite-component-1.0.0 app/helpers/lite/component/component_helper.rb