Module: Spark::Component

Defined in:
lib/spark/component.rb,
lib/spark/component/attr.rb,
lib/spark/component/element.rb,
lib/spark/component/version.rb,
lib/spark/component/tag_attr.rb,
lib/spark/component/attribute.rb,
lib/spark/component/classname.rb,
lib/spark/component/integration/action_view_component.rb

Defined Under Namespace

Modules: Attribute, Element, Integration Classes: Attr, Classname, TagAttr

Constant Summary collapse

VERSION =
"1.1.5"
BASE_ATTRIBUTES =
%i[id class data aria html].freeze

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'lib/spark/component.rb', line 13

def self.included(base)
  base.include Spark::Component::Attribute
  base.include Spark::Component::Element

  # If an Integration is defeind include its modules if the component extends
  # the defined base class
  return unless defined?(Spark::Component::Integration)

  base.include(Spark::Component::Integration) if base < Spark::Component::Integration.base_class
end