Skip to content

Commit

Permalink
Fix uninitialized variable @dom_attributes warning
Browse files Browse the repository at this point in the history
  • Loading branch information
johantell committed Mar 5, 2019
1 parent abadde3 commit 9195cb0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/simple_navigation/item_container.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def initialize(level = 1) #:nodoc:
@items ||= []
@renderer = SimpleNavigation.config.renderer
@auto_highlight = true
@dom_attributes = {}
end

def dom_attributes
Expand All @@ -24,7 +25,8 @@ def dom_attributes
id: dom_id,
class: dom_class
}.reject { |_, v| v.nil? }
(@dom_attributes || {}).merge(dom_id_and_class)

@dom_attributes.merge(dom_id_and_class)
end

# Creates a new navigation item.
Expand Down

0 comments on commit 9195cb0

Please sign in to comment.