Sha256: fdc55445a028dc69f24c095409fabb6de459ca1a7ed1420fe088b8ae200f8ba7

Contents?: true

Size: 735 Bytes

Versions: 6

Compression:

Stored size: 735 Bytes

Contents

module Aureus
  module Components
    class Navigation < Renderable
      def initialize
        @title = ''
        @buttons = Array.new
        yield(self)
      end

      def title(title)
        @title = title
      end

      def button(content)
        @buttons << NavigationButton.new(content)
      end

      def render
        content_tag 'div', class: 'aureus-navigation' do
          compact content_tag('h2', content_tag('span', @title)), content_tag('ul', compact_render(*@buttons), id: 'quicklinks')
        end
      end
    end

    class NavigationButton < Renderable
      def initialize(content)
        @content = content
      end

      def render
        content_tag 'li', @content
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
aureus-3.0.5 lib/aureus/components/navigation.rb
aureus-3.0.4 lib/aureus/components/navigation.rb
aureus-3.0.3 lib/aureus/components/navigation.rb
aureus-3.0.2 lib/aureus/components/navigation.rb
aureus-3.0.1 lib/aureus/components/navigation.rb
aureus-3.0.0 lib/aureus/components/navigation.rb