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.
7 8 9 10 11 12 |
# 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_definition = false self.strict_mode = false self.without_group = false 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_definition ⇒ Object
Returns the value of attribute auto_definition.
4 5 6 |
# File 'lib/i_am_i_can/configs/config.rb', line 4 def auto_definition @auto_definition 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
26 27 28 |
# File 'lib/i_am_i_can/configs/config.rb', line 26 def ||= .constantize end |
#role_group_model ⇒ Object
22 23 24 |
# File 'lib/i_am_i_can/configs/config.rb', line 22 def role_group_model @role_group_model ||= role_group_class.constantize rescue nil end |
#role_model ⇒ Object
18 19 20 |
# File 'lib/i_am_i_can/configs/config.rb', line 18 def role_model @role_model ||= role_class.constantize end |
#subject_model ⇒ Object
14 15 16 |
# File 'lib/i_am_i_can/configs/config.rb', line 14 def subject_model @subject_model ||= subject_class.constantize end |