Module: Katalyst::HtmlAttributes

Extended by:
ActiveSupport::Concern
Defined in:
lib/katalyst/html_attributes.rb,
lib/katalyst/html_attributes/has_html_attributes.rb

Defined Under Namespace

Modules: HasHtmlAttributes

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.options_to_html_attributes(options) ⇒ Object



11
12
13
# File 'lib/katalyst/html_attributes.rb', line 11

def self.options_to_html_attributes(options)
  options.slice(:id, :aria, :class, :data).merge_html(options.fetch(:html, {}))
end

Instance Method Details

#initialize(**options) ⇒ Object



41
42
43
44
45
# File 'lib/katalyst/html_attributes.rb', line 41

def initialize(**options)
  super(**options.except(:id, :aria, :class, :data, :html))

  self.html_attributes = options
end