Sha256: 6903451b445c50f34bcd15a649df4df3bd7e7ceb57f0fe51aa6c5aa34ad6d0a1

Contents?: true

Size: 542 Bytes

Versions: 51

Compression:

Stored size: 542 Bytes

Contents

module Rao
  module Component
    class Base
      def initialize(view, options = {}, &block)
        @view        = view
        @block       = block
        @options     = options
        @view_locals = {}
      end

      def perform
        @block_output = block_output
        @view.render partial: self.class.name.underscore, locals: view_locals
      end

      private

      attr_reader :view_locals

      def block_output
        return unless @block.present?
        @view.capture { @block.call(self) }
      end
    end
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
rao-component-0.0.52.pre app/components/rao/component/base.rb
rao-component-0.0.51.pre app/components/rao/component/base.rb
rao-component-0.0.50.pre app/components/rao/component/base.rb
rao-component-0.0.49.pre app/components/rao/component/base.rb
rao-component-0.0.48.pre app/components/rao/component/base.rb
rao-component-0.0.47.pre app/components/rao/component/base.rb
rao-component-0.0.46.pre app/components/rao/component/base.rb
rao-component-0.0.45.pre app/components/rao/component/base.rb
rao-component-0.0.44.pre app/components/rao/component/base.rb
rao-component-0.0.43.pre app/components/rao/component/base.rb
rao-component-0.0.42.pre app/components/rao/component/base.rb
rao-component-0.0.41.pre app/components/rao/component/base.rb
rao-component-0.0.40.pre app/components/rao/component/base.rb
rao-component-0.0.39.pre app/components/rao/component/base.rb
rao-component-0.0.38.pre app/components/rao/component/base.rb
rao-component-0.0.37.pre app/components/rao/component/base.rb
rao-component-0.0.36.pre app/components/rao/component/base.rb
rao-component-0.0.35.pre app/components/rao/component/base.rb
rao-component-0.0.34.pre app/components/rao/component/base.rb
rao-component-0.0.33.pre app/components/rao/component/base.rb