Class: AmaLayout::Navigation

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model, Draper::Decoratable
Defined in:
lib/ama_layout/navigation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#current_urlObject

Returns the value of attribute current_url.



6
7
8
# File 'lib/ama_layout/navigation.rb', line 6

def current_url
  @current_url
end

#userObject

Returns the value of attribute user.



6
7
8
# File 'lib/ama_layout/navigation.rb', line 6

def user
  @user
end

Instance Method Details

#itemsObject



21
22
23
24
25
# File 'lib/ama_layout/navigation.rb', line 21

def items
  navigation_items.fetch(user.try(:navigation), []).map do |n|
    NavigationItem.new n.merge({ current_url: current_url})
  end
end