Class: IAmICan::Configs::Config
- Inherits:
-
Object
- Object
- IAmICan::Configs::Config
- Defined in:
- lib/i_am_i_can/configs/config.rb
Instance Attribute Summary collapse
-
#act ⇒ Object
Returns the value of attribute act.
-
#auto_definition ⇒ Object
Returns the value of attribute auto_definition.
-
#permission_class ⇒ Object
Returns the value of attribute permission_class.
-
#role_class ⇒ Object
Returns the value of attribute role_class.
-
#role_group_class ⇒ Object
Returns the value of attribute role_group_class.
-
#strict_mode ⇒ Object
Returns the value of attribute strict_mode.
-
#subject_class ⇒ Object
Returns the value of attribute subject_class.
-
#without_group ⇒ Object
Returns the value of attribute without_group.
Instance Method Summary collapse
-
#initialize(*classes) ⇒ Config
constructor
A new instance of Config.
- #permission_model ⇒ Object
- #role_group_model ⇒ Object
- #role_model ⇒ Object
- #subject_model ⇒ Object
Constructor Details
#initialize(*classes) ⇒ Config
Returns a new instance of Config.
9 10 11 12 13 14 |
# File 'lib/i_am_i_can/configs/config.rb', line 9 def initialize(*classes) self.subject_class, self.role_class, self., self.role_group_class = classes self.auto_definition = false self.strict_mode = false self.without_group = false end |
Instance Attribute Details
#act ⇒ Object
Returns the value of attribute act.
6 7 8 |
# File 'lib/i_am_i_can/configs/config.rb', line 6 def act @act end |
#auto_definition ⇒ Object
Returns the value of attribute auto_definition.
6 7 8 |
# File 'lib/i_am_i_can/configs/config.rb', line 6 def auto_definition @auto_definition end |
#permission_class ⇒ Object
Returns the value of attribute permission_class.
6 7 8 |
# File 'lib/i_am_i_can/configs/config.rb', line 6 def end |
#role_class ⇒ Object
Returns the value of attribute role_class.
6 7 8 |
# File 'lib/i_am_i_can/configs/config.rb', line 6 def role_class @role_class end |
#role_group_class ⇒ Object
Returns the value of attribute role_group_class.
6 7 8 |
# File 'lib/i_am_i_can/configs/config.rb', line 6 def role_group_class @role_group_class end |
#strict_mode ⇒ Object
Returns the value of attribute strict_mode.
6 7 8 |
# File 'lib/i_am_i_can/configs/config.rb', line 6 def strict_mode @strict_mode end |
#subject_class ⇒ Object
Returns the value of attribute subject_class.
6 7 8 |
# File 'lib/i_am_i_can/configs/config.rb', line 6 def subject_class @subject_class end |
#without_group ⇒ Object
Returns the value of attribute without_group.
6 7 8 |
# File 'lib/i_am_i_can/configs/config.rb', line 6 def without_group @without_group end |
Instance Method Details
#permission_model ⇒ Object
28 29 30 |
# File 'lib/i_am_i_can/configs/config.rb', line 28 def ||= .constantize end |
#role_group_model ⇒ Object
24 25 26 |
# File 'lib/i_am_i_can/configs/config.rb', line 24 def role_group_model @role_group_model ||= role_group_class.constantize rescue nil end |
#role_model ⇒ Object
20 21 22 |
# File 'lib/i_am_i_can/configs/config.rb', line 20 def role_model @role_model ||= role_class.constantize end |
#subject_model ⇒ Object
16 17 18 |
# File 'lib/i_am_i_can/configs/config.rb', line 16 def subject_model @subject_model ||= subject_class.constantize end |