Sha256: 56200bf396b8f16df6352b82a3b9834596b7945a6e37fd9bdf8268af75b9888b

Contents?: true

Size: 451 Bytes

Versions: 8

Compression:

Stored size: 451 Bytes

Contents

module SmallCage
  module MenuHelper

    def menu_active(name)
      p = @obj["menu_path"]
      p ||= @obj["uri"]
      return p =~ %r{^/#{name}/} ? "active" : "inactive"
    end

    def menu_active_rex(rex)
      p = @obj["menu_path"]
      p ||= @obj["uri"]
      return p =~ rex ? "active" : "inactive"
    end

    def topic_dirs
      result = @obj["dirs"].dup
      result.reject! {|d| d["topic"].nil? }
      return result
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
smallcage-0.3.2 project/standard/_smc/helpers/menu_helper.rb
smallcage-0.3.1 project/standard/_smc/helpers/menu_helper.rb
smallcage-0.3.0 project/standard/_smc/helpers/menu_helper.rb
smallcage-0.2.9 project/standard/_smc/helpers/menu_helper.rb
smallcage-0.2.8 project/standard/_smc/helpers/menu_helper.rb
smallcage-0.2.7 project/standard/_smc/helpers/menu_helper.rb
smallcage-0.2.6 project/standard/_smc/helpers/menu_helper.rb
smallcage-0.2.5 project/standard/_smc/helpers/menu_helper.rb