Class: AmaLayout::Agent::Navigation
- Inherits:
-
Object
- Object
- AmaLayout::Agent::Navigation
- Includes:
- ActiveModel::Model
- Defined in:
- lib/ama_layout/agent/navigation.rb
Instance Attribute Summary collapse
-
#current_url ⇒ Object
Returns the value of attribute current_url.
-
#display_name ⇒ Object
Returns the value of attribute display_name.
-
#nav_file_path ⇒ Object
Returns the value of attribute nav_file_path.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
- #decorate ⇒ Object
-
#initialize(args = {}) ⇒ Navigation
constructor
A new instance of Navigation.
- #items ⇒ Object
- #navigation_items ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ Navigation
Returns a new instance of Navigation.
12 13 14 15 |
# File 'lib/ama_layout/agent/navigation.rb', line 12 def initialize(args = {}) args = defaults.merge args super end |
Instance Attribute Details
#current_url ⇒ Object
Returns the value of attribute current_url.
10 11 12 |
# File 'lib/ama_layout/agent/navigation.rb', line 10 def current_url @current_url end |
#display_name ⇒ Object
Returns the value of attribute display_name.
10 11 12 |
# File 'lib/ama_layout/agent/navigation.rb', line 10 def display_name @display_name end |
#nav_file_path ⇒ Object
Returns the value of attribute nav_file_path.
10 11 12 |
# File 'lib/ama_layout/agent/navigation.rb', line 10 def nav_file_path @nav_file_path end |
#user ⇒ Object
Returns the value of attribute user.
10 11 12 |
# File 'lib/ama_layout/agent/navigation.rb', line 10 def user @user end |
Instance Method Details
#decorate ⇒ Object
6 7 8 |
# File 'lib/ama_layout/agent/navigation.rb', line 6 def decorate AmaLayout::Agent::.new(self) end |
#items ⇒ Object
17 18 19 20 21 |
# File 'lib/ama_layout/agent/navigation.rb', line 17 def items .map do |n| .new n.merge({ current_url: current_url}) end end |
#navigation_items ⇒ Object
23 24 25 |
# File 'lib/ama_layout/agent/navigation.rb', line 23 def YAML.load ERB.new(File.read nav_file_path).result end |