Class: Padrino::Admin::AccessControl::ProjectModule
- Defined in:
- padrino-admin/lib/padrino-admin/access_control.rb
Overview
Project Module class.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#human_name ⇒ Object
Returns the name of the project module humanize them for you.
-
#initialize(name, path, options = {}) ⇒ ProjectModule
constructor
A new instance of ProjectModule.
-
#path(prefix = nil) ⇒ Object
Return the path of the project module.
Constructor Details
#initialize(name, path, options = {}) ⇒ ProjectModule
Returns a new instance of ProjectModule.
169 170 171 |
# File 'padrino-admin/lib/padrino-admin/access_control.rb', line 169 def initialize(name, path, ={}) @name, @path, @options = name, path, end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
167 168 169 |
# File 'padrino-admin/lib/padrino-admin/access_control.rb', line 167 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
167 168 169 |
# File 'padrino-admin/lib/padrino-admin/access_control.rb', line 167 def @options end |
Instance Method Details
#human_name ⇒ Object
Returns the name of the project module humanize them for you.
176 177 178 |
# File 'padrino-admin/lib/padrino-admin/access_control.rb', line 176 def human_name @name.to_s.humanize end |
#path(prefix = nil) ⇒ Object
Return the path of the project module. If a prefix given will be pre pended.
189 190 191 192 193 |
# File 'padrino-admin/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 |