Sha256: fd71650c600f4820e6d7c5e9783a535924be2a88973931bd72d62a8921a6db0c

Contents?: true

Size: 784 Bytes

Versions: 6

Compression:

Stored size: 784 Bytes

Contents

require_relative '<%= underscore(name) %>_component'

module Voom
  module Presenters
    module Plugins
      module <%= classify(name) %>
        # Components add new methods to the POM component hierarchy. They should add a component object to the
        # POM component stream. These components are the declarative instructions that are used to render a client.
        # POM components require corresponding views templates and JS that render them.
        # Name this method whatever you want.
        module DSLComponents
          def <%= underscore(name) %>(random_fact, **attributes, &block)
            self << <%= classify(name) %>::<%= classify(name) %>Component.new(random_fact, parent: self, **attributes, &block)
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
voom-presenters-2.1.2 lib/voom/presenters/generators/templates/plugin/lib/voom/presenters/plugins/components/dsl.rb.tt
voom-presenters-2.1.0 lib/voom/presenters/generators/templates/plugin/lib/voom/presenters/plugins/components/dsl.rb.tt
voom-presenters-2.0.3 lib/voom/presenters/generators/templates/plugin/lib/voom/presenters/plugins/components/dsl.rb.tt
voom-presenters-2.0.2 lib/voom/presenters/generators/templates/plugin/lib/voom/presenters/plugins/components/dsl.rb.tt
voom-presenters-2.0.1 lib/voom/presenters/generators/templates/plugin/lib/voom/presenters/plugins/components/dsl.rb.tt
voom-presenters-2.0.0 lib/voom/presenters/generators/templates/plugin/lib/voom/presenters/plugins/components/dsl.rb.tt