class Padrino::Admin::AccessControl::ProjectModule

Project Module class.

Attributes

name[R]
options[R]

Public Class Methods

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

Public Instance Methods

human_name() click to toggle source

Returns the name of the project module humanize them for you.

# File lib/padrino-admin/access_control.rb, line 176
def human_name
   @name.to_s.humanize
end
path(prefix=nil) click to toggle source

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

@example

# => /accounts/new
project_module.path
# => /admin/accounts
project_module.path("/admin")
# File lib/padrino-admin/access_control.rb, line 189
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