Sha256: bdcfdb7563da526c913943848868be51efc03c251829959ef34835dbc9635489

Contents?: true

Size: 692 Bytes

Versions: 4

Compression:

Stored size: 692 Bytes

Contents

module Hyperstack
  module Component
    module FreeRender
      def self.included(base)
        base.instance_eval do
          alias :hyperstack_component_original_meth_missing method_missing
          def method_missing(name, *args, &block)
            if const_defined?(name) &&
               (klass = const_get(name)) &&
               ((klass.is_a?(Class) && klass.method_defined?(:render)) ||
                 Hyperstack::Internal::Component::Tags::HTML_TAGS.include?(klass))
              render(klass, *args, &block)
            else
              hyperstack_component_original_meth_missing(name, *args, &block)
            end
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hyper-component-1.0.alpha1.8 lib/hyperstack/component/free_render.rb
hyper-component-1.0.alpha1.7 lib/hyperstack/component/free_render.rb
hyper-component-1.0.alpha1.6 lib/hyperstack/component/free_render.rb
hyper-component-1.0.alpha1.5 lib/hyperstack/component/free_render.rb