Sha256: 7f7e18ef96c87b71101262c44516631cc5e8721cbbee17193bc303e7400c465e
Contents?: true
Size: 832 Bytes
Versions: 1
Compression:
Stored size: 832 Bytes
Contents
# frozen_string_literal: true module Phlexi module Table module Components class Base < COMPONENT_BASE attr_reader :field, :attributes def initialize(field, **attributes) @field = field @attributes = attributes build_attributes append_attribute_classes end protected def build_attributes attributes.fetch(:id) { attributes[:id] = "#{field.dom.id}_#{component_name}" } end def append_attribute_classes return if attributes[:class] == false attributes[:class] = tokens( component_name, attributes[:class] ) end def component_name @component_name ||= self.class.name.demodulize.underscore end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
phlexi-table-0.0.1 | lib/phlexi/table/components/base.rb |