Sha256: 3d26f8ac3226ca041328d4b4d38e83d8df1ecc62ed72f13356d98e8b5435d89c
Contents?: true
Size: 780 Bytes
Versions: 25
Compression:
Stored size: 780 Bytes
Contents
module AmaLayout module Agent class Navigation include ActiveModel::Model def decorate AmaLayout::Agent::NavigationDecorator.new(self) end attr_accessor :user, :current_url, :nav_file_path, :display_name def initialize(args = {}) args = defaults.merge args super end def items navigation_items.map do |n| NavigationItem.new n.merge({ current_url: current_url}) end end def navigation_items YAML.load ERB.new(File.read nav_file_path).result end private def defaults { nav_file_path: File.join(Gem.loaded_specs["ama_layout"].full_gem_path, "lib", "ama_layout", "agent_navigation.yml") } end end end end
Version data entries
25 entries across 25 versions & 1 rubygems