Class: Navigatrix::Rendering::Strategies::List::HTMLAttributes

Inherits:
HashWithIndifferentAccess
  • Object
show all
Defined in:
lib/navigatrix/rendering/strategies/list.rb

Instance Method Summary collapse

Instance Method Details

#attribute_values(attribute) ⇒ Object



95
96
97
# File 'lib/navigatrix/rendering/strategies/list.rb', line 95

def attribute_values(attribute)
  fetch(attribute, "").to_s.split(" ")
end

#merge_attribute(attribute, value) ⇒ Object



89
90
91
92
93
# File 'lib/navigatrix/rendering/strategies/list.rb', line 89

def merge_attribute(attribute, value)
  tap do
    self[attribute] = attribute_values(attribute).push(value).join(" ")
  end
end