Sha256: b40de2007fc399e2f1eb9725fd74353dff1cdf80a354cb633f2b390de78aa04a

Contents?: true

Size: 404 Bytes

Versions: 3

Compression:

Stored size: 404 Bytes

Contents

# frozen_string_literal: true
module Arbre
  class Component < Arbre::HTML::Div

    # By default components render a div
    def tag_name
      'div'
    end

    def initialize(*)
      super
      add_class default_class_name
    end

    protected

    # By default, add a css class named after the ruby class
    def default_class_name
      self.class.name.demodulize.underscore
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
arbre-1.7.0 lib/arbre/component.rb
arbre-1.6.0 lib/arbre/component.rb
arbre-1.5.0 lib/arbre/component.rb