Sha256: eb88570c099d888cc542ac8ac42ebdd38640948bc750296885e6ce7464cea5a4

Contents?: true

Size: 926 Bytes

Versions: 48

Compression:

Stored size: 926 Bytes

Contents

module PushType
  module MenuBuilder
    module Dsl

      class MenuItem
        class << self
          def build(item, &block)
            @item = item
            instance_exec(&block)
            @item.validate!
          end

          def text(val=nil, &block)
            @item.text = block_given? ? block : val
          end

          def link(val=nil, &block)
            @item.link = block_given? ? block : val
          end

          def active(val=nil, &block)
            @item.active = block_given? ? block : val
          end

          def element(val)
            @item.element = val
          end

          def item_options(hash)
            @item.item_options.merge!(hash)
          end

          def link_options(hash)
            @item.link_options.merge!(hash)
          end

          def active_class(val)
            @item.active_class = val
          end
        end
      end

    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
push_type_core-0.9.0.beta.3 lib/push_type/menu_builder/dsl/menu_item.rb
push_type_core-0.9.0.beta.2 lib/push_type/menu_builder/dsl/menu_item.rb
push_type_core-0.8.2 lib/push_type/menu_builder/dsl/menu_item.rb
push_type_core-0.8.1 lib/push_type/menu_builder/dsl/menu_item.rb
push_type_core-0.8.0 lib/push_type/menu_builder/dsl/menu_item.rb
push_type_core-0.8.0.beta.3 lib/push_type/menu_builder/dsl/menu_item.rb
push_type_core-0.8.0.beta.2 lib/push_type/menu_builder/dsl/menu_item.rb
push_type_core-0.8.0.beta.1 lib/push_type/menu_builder/dsl/menu_item.rb
push_type_core-0.7.0 lib/push_type/menu_builder/dsl/menu_item.rb
push_type_core-0.7.0.beta.1 lib/push_type/menu_builder/dsl/menu_item.rb
push_type_core-0.6.0 lib/push_type/menu_builder/dsl/menu_item.rb
push_type_core-0.6.0.beta.4 lib/push_type/menu_builder/dsl/menu_item.rb
push_type_core-0.6.0.beta.3 lib/push_type/menu_builder/dsl/menu_item.rb
push_type_core-0.6.0.beta.2 lib/push_type/menu_builder/dsl/menu_item.rb
push_type_core-0.6.0.beta.1 lib/push_type/menu_builder/dsl/menu_item.rb
push_type_core-0.5.3 lib/push_type/menu_builder/dsl/menu_item.rb
push_type_core-0.5.2 lib/push_type/menu_builder/dsl/menu_item.rb
push_type_core-0.5.1 lib/push_type/menu_builder/dsl/menu_item.rb
push_type_core-0.5.0 lib/push_type/menu_builder/dsl/menu_item.rb
push_type_core-0.5.0.alpha.5 lib/push_type/menu_builder/dsl/menu_item.rb