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

Version Path
station-0.0.120 lib/nexmo_developer/app/presenters/topnav.rb
station-0.0.119 lib/nexmo_developer/app/presenters/topnav.rb
station-0.0.118 lib/nexmo_developer/app/presenters/topnav.rb
station-0.0.115 lib/nexmo_developer/app/presenters/topnav.rb
station-0.0.114 lib/nexmo_developer/app/presenters/topnav.rb
station-0.0.113 lib/nexmo_developer/app/presenters/topnav.rb
station-0.0.112 lib/nexmo_developer/app/presenters/topnav.rb
station-0.0.111 lib/nexmo_developer/app/presenters/topnav.rb
station-0.0.110 lib/nexmo_developer/app/presenters/topnav.rb
station-0.0.109 lib/nexmo_developer/app/presenters/topnav.rb
station-0.0.108 lib/nexmo_developer/app/presenters/topnav.rb
station-0.0.107 lib/nexmo_developer/app/presenters/topnav.rb
station-0.0.106 lib/nexmo_developer/app/presenters/topnav.rb
station-0.0.105 lib/nexmo_developer/app/presenters/topnav.rb
station-0.0.104 lib/nexmo_developer/app/presenters/topnav.rb
station-0.0.103 lib/nexmo_developer/app/presenters/topnav.rb
station-0.0.102 lib/nexmo_developer/app/presenters/topnav.rb
station-0.0.101 lib/nexmo_developer/app/presenters/topnav.rb
station-0.0.100 lib/nexmo_developer/app/presenters/topnav.rb
station-0.0.97 lib/nexmo_developer/app/presenters/topnav.rb