Class: Vinyl::Configuration
- Inherits:
-
Object
- Object
- Vinyl::Configuration
- Defined in:
- lib/vinyl/base.rb
Constant Summary collapse
- STRATEGY_DESCENDING =
Check for validators starting on the highest access level
1- STRATEGY_ASCENDING =
Check for validators starting on the lowest access level
2- @@defaults =
{ :api_acl_mode => STRATEGY_DESCENDING, :force_access_control => false, :warn_on_missing_validators => true }
Instance Attribute Summary collapse
-
#api_acl_mode ⇒ Object
Returns the value of attribute api_acl_mode.
-
#force_access_control ⇒ Object
Returns the value of attribute force_access_control.
-
#warn_on_missing_validators ⇒ Object
Returns the value of attribute warn_on_missing_validators.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #validators_iterate_strategy ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
68 69 70 |
# File 'lib/vinyl/base.rb', line 68 def initialize @@defaults.each_pair{|k,v| self.send("#{k}=",v)} end |
Instance Attribute Details
#api_acl_mode ⇒ Object
Returns the value of attribute api_acl_mode.
46 47 48 |
# File 'lib/vinyl/base.rb', line 46 def api_acl_mode @api_acl_mode end |
#force_access_control ⇒ Object
Returns the value of attribute force_access_control.
46 47 48 |
# File 'lib/vinyl/base.rb', line 46 def force_access_control @force_access_control end |
#warn_on_missing_validators ⇒ Object
Returns the value of attribute warn_on_missing_validators.
46 47 48 |
# File 'lib/vinyl/base.rb', line 46 def warn_on_missing_validators @warn_on_missing_validators end |
Class Method Details
.defaults ⇒ Object
64 65 66 |
# File 'lib/vinyl/base.rb', line 64 def self.defaults @@defaults end |
Instance Method Details
#validators_iterate_strategy ⇒ Object
56 57 58 59 60 61 62 |
# File 'lib/vinyl/base.rb', line 56 def validators_iterate_strategy if(@api_acl_mode == STRATEGY_DESCENDING) then return 'reverse_each' else return 'each' end end |