Class: CanTango::Builder::Permit::Base
- Inherits:
-
Object
- Object
- CanTango::Builder::Permit::Base
- Extended by:
- ClassMethods
- Includes:
- Helpers::Debug
- Defined in:
- lib/cantango/permits_ext/builder/permit/base.rb
Direct Known Subclasses
Defined Under Namespace
Modules: ClassMethods Classes: CreatePermitError
Instance Attribute Summary collapse
-
#ability ⇒ Object
Returns the value of attribute ability.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#build ⇒ Array<Permit::Base>
builds a list of Permits for each role of the current ability user (or account).
-
#initialize(ability, options = {}) ⇒ Base
constructor
creates the factory for the ability note that the ability contains the roles and role groups of the user (or account).
- #permit_type ⇒ Object
Methods included from Permit::Helper::Naming
Constructor Details
#initialize(ability, options = {}) ⇒ Base
creates the factory for the ability note that the ability contains the roles and role groups of the user (or account)
16 17 18 |
# File 'lib/cantango/permits_ext/builder/permit/base.rb', line 16 def initialize ability, = {} @ability, @options = [ability, ] end |
Instance Attribute Details
#ability ⇒ Object
Returns the value of attribute ability.
8 9 10 |
# File 'lib/cantango/permits_ext/builder/permit/base.rb', line 8 def ability @ability end |
#options ⇒ Object
Returns the value of attribute options.
8 9 10 |
# File 'lib/cantango/permits_ext/builder/permit/base.rb', line 8 def @options end |
Instance Method Details
#build ⇒ Array<Permit::Base>
builds a list of Permits for each role of the current ability user (or account)
31 32 33 34 |
# File 'lib/cantango/permits_ext/builder/permit/base.rb', line 31 def build debug debug_msg permits end |
#permit_type ⇒ Object
25 26 27 |
# File 'lib/cantango/permits_ext/builder/permit/base.rb', line 25 def permit_type self.class.permit_name end |