Sha256: 7751ecf2294132bf21d16cf61e24685c363dc1912d54eba898aa0108f0c777ee

Contents?: true

Size: 553 Bytes

Versions: 2

Compression:

Stored size: 553 Bytes

Contents

module Navi
  module Renderers
    module SimpleNavigation
      class DynamicItem < Hash

        def initialize(template, nav_item, options={})
          self[:key] = template.dom_id(nav_item).to_sym
          self[:name] = nav_item.label
          self[:url] = GeneratesUri.execute(template, nav_item, options)
          self[:options] = {title: nav_item.title,
                            class: nav_item.class.name.underscore}
          self[:items] = DynamicItems.new(template, nav_item.children, options)
        end

      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
navi-0.2.1 lib/navi/renderers/simple_navigation/dynamic_item.rb
navi-0.2.0 lib/navi/renderers/simple_navigation/dynamic_item.rb