Parent

Files

Padrino::Admin::AccessControl::ProjectModule

Project Module class

Attributes

name[R]

Public Class Methods

new(name, path) click to toggle source
# File lib/padrino-admin/access_control.rb, line 160
def initialize(name, path) # @private
  @name, @path = name, path
end

Public Instance Methods

human_name() click to toggle source

Returns the name of the project module. If a symbol it translate/humanize them for you.

# File lib/padrino-admin/access_control.rb, line 167
def human_name
  @name.is_a?(Symbol) ? I18n.t("padrino.admin.menu.#{@name}", :default => @name.to_s.humanize) : @name
end
path(prefix=nil) click to toggle source

Return the path of the project module. If a prefix given will be prepended.

@example

# => /accounts/new
project_module.path
# => /admin/accounts
project_module.path("/admin")
# File lib/padrino-admin/access_control.rb, line 180
def path(prefix=nil)
  path = prefix ? File.join(prefix, @path) : @path
  path = File.join(ENV['RACK_BASE_URI'].to_s, path) if ENV['RACK_BASE_URI']
  path
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.