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
170 171 172 |
# File 'padrino-admin/lib/padrino-admin/access_control.rb', line 170 def initialize(name, path, = {}) @name, @path, = name, path, end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
168 169 170 |
# File 'padrino-admin/lib/padrino-admin/access_control.rb', line 168 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
168 169 170 |
# File 'padrino-admin/lib/padrino-admin/access_control.rb', line 168 def end |
Instance Method Details
#human_name ⇒ Object
Returns the name of the project module humanize them for you.
177 178 179 |
# File 'padrino-admin/lib/padrino-admin/access_control.rb', line 177 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.
190 191 192 193 194 |
# File 'padrino-admin/lib/padrino-admin/access_control.rb', line 190 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 |