Class: Rafflesia::AccessPolicy

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/registry/access_policy.rb

Constant Summary collapse

HASH_ATTRS =
{
  grants: :grants,
  id: :id
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#grantsObject

Returns the value of attribute grants.



13
14
15
# File 'lib/rafflesia/registry/access_policy.rb', line 13

def grants
  @grants
end

#idObject

Returns the value of attribute id.



13
14
15
# File 'lib/rafflesia/registry/access_policy.rb', line 13

def id
  @id
end