Class: Objectify::Config::Policies
- Inherits:
-
Object
- Object
- Objectify::Config::Policies
- Defined in:
- lib/objectify/config/policies.rb
Instance Attribute Summary collapse
-
#policies ⇒ Object
readonly
Returns the value of attribute policies.
-
#skip_policies ⇒ Object
readonly
Returns the value of attribute skip_policies.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Policies
constructor
A new instance of Policies.
- #merge(*others) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Policies
Returns a new instance of Policies.
6 7 8 9 |
# File 'lib/objectify/config/policies.rb', line 6 def initialize( = {}) @policies = [*[:policies]] @skip_policies = [*[:skip_policies]] end |
Instance Attribute Details
#policies ⇒ Object (readonly)
Returns the value of attribute policies.
4 5 6 |
# File 'lib/objectify/config/policies.rb', line 4 def policies @policies end |
#skip_policies ⇒ Object (readonly)
Returns the value of attribute skip_policies.
4 5 6 |
# File 'lib/objectify/config/policies.rb', line 4 def skip_policies @skip_policies end |
Instance Method Details
#merge(*others) ⇒ Object
11 12 13 14 15 |
# File 'lib/objectify/config/policies.rb', line 11 def merge(*others) others.compact.inject(@policies - @skip_policies) do |total, opts| total + [*opts[:policies]] - [*opts[:skip_policies]] end end |