Class: Rafflesia::AccessPolicy
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::AccessPolicy
- Defined in:
- lib/rafflesia/registry/access_policy.rb
Constant Summary collapse
- HASH_ATTRS =
{ grants: :grants, id: :id }.freeze
Instance Attribute Summary collapse
-
#grants ⇒ Object
Returns the value of attribute grants.
-
#id ⇒ Object
Returns the value of attribute id.
Instance Method Summary collapse
-
#initialize(json) ⇒ AccessPolicy
constructor
A new instance of AccessPolicy.
Constructor Details
#initialize(json) ⇒ AccessPolicy
Returns a new instance of AccessPolicy.
17 18 19 20 21 22 |
# File 'lib/rafflesia/registry/access_policy.rb', line 17 def initialize(json) super() hash = self.class.normalize(json) @grants = (hash[:grants] || []).map { |item| item ? Rafflesia::AccessGrant.new(item) : nil } @id = hash[:id] end |
Instance Attribute Details
#grants ⇒ Object
Returns the value of attribute grants.
13 14 15 |
# File 'lib/rafflesia/registry/access_policy.rb', line 13 def grants @grants end |
#id ⇒ Object
Returns the value of attribute id.
13 14 15 |
# File 'lib/rafflesia/registry/access_policy.rb', line 13 def id @id end |