Sha256: 132a7717bf236a6d7e0c4dc6a9b19f895da9bce2495cd90e66a9f72c311d97dd
Contents?: true
Size: 512 Bytes
Versions: 23
Compression:
Stored size: 512 Bytes
Contents
class Topnav CONFIG = "#{Rails.configuration.docs_base_path}/config/top_navigation.yml".freeze def initialize(navigation) @navigation = navigation after_initialize! end def items @items ||= begin YAML.safe_load(File.open(CONFIG)).map do |name, url| TopnavItem.new(name, url, @navigation) end end end private def after_initialize! raise 'You must provide a config/top_navigation.yml file in your documentation path.' unless File.exist?(CONFIG) end end
Version data entries
23 entries across 23 versions & 1 rubygems