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_define_before ⇒ Object
Returns the value of attribute auto_define_before.
-
#default_save ⇒ Object
Returns the value of attribute default_save.
-
#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.
7 8 9 10 11 12 13 |
# File 'lib/i_am_i_can/configs/config.rb', line 7 def initialize(*classes) self.subject_class, self.role_class, self., self.role_group_class = classes self.auto_define_before = false self.strict_mode = false self.without_group = false self.default_save = true end |
Instance Attribute Details
#act ⇒ Object
Returns the value of attribute act.
4 5 6 |
# File 'lib/i_am_i_can/configs/config.rb', line 4 def act @act end |
#auto_define_before ⇒ Object
Returns the value of attribute auto_define_before.
4 5 6 |
# File 'lib/i_am_i_can/configs/config.rb', line 4 def auto_define_before @auto_define_before end |
#default_save ⇒ Object
Returns the value of attribute default_save.
4 5 6 |
# File 'lib/i_am_i_can/configs/config.rb', line 4 def default_save @default_save end |
#permission_class ⇒ Object
Returns the value of attribute permission_class.
4 5 6 |
# File 'lib/i_am_i_can/configs/config.rb', line 4 def end |
#role_class ⇒ Object
Returns the value of attribute role_class.
4 5 6 |
# File 'lib/i_am_i_can/configs/config.rb', line 4 def role_class @role_class end |
#role_group_class ⇒ Object
Returns the value of attribute role_group_class.
4 5 6 |
# File 'lib/i_am_i_can/configs/config.rb', line 4 def role_group_class @role_group_class end |
#strict_mode ⇒ Object
Returns the value of attribute strict_mode.
4 5 6 |
# File 'lib/i_am_i_can/configs/config.rb', line 4 def strict_mode @strict_mode end |
#subject_class ⇒ Object
Returns the value of attribute subject_class.
4 5 6 |
# File 'lib/i_am_i_can/configs/config.rb', line 4 def subject_class @subject_class end |
#without_group ⇒ Object
Returns the value of attribute without_group.
4 5 6 |
# File 'lib/i_am_i_can/configs/config.rb', line 4 def without_group @without_group end |
Instance Method Details
#permission_model ⇒ Object
27 28 29 |
# File 'lib/i_am_i_can/configs/config.rb', line 27 def ||= .constantize end |
#role_group_model ⇒ Object
23 24 25 |
# File 'lib/i_am_i_can/configs/config.rb', line 23 def role_group_model @role_group_model ||= role_group_class.constantize rescue nil end |
#role_model ⇒ Object
19 20 21 |
# File 'lib/i_am_i_can/configs/config.rb', line 19 def role_model @role_model ||= role_class.constantize end |
#subject_model ⇒ Object
15 16 17 |
# File 'lib/i_am_i_can/configs/config.rb', line 15 def subject_model @subject_model ||= subject_class.constantize end |