Class: Checkpoint::Resource::AllOfAnyType

Inherits:
Checkpoint::Resource show all
Defined in:
lib/checkpoint/resource/all_of_any_type.rb

Overview

Specialized Resource type to represent all entities of a any/all types. This is used for zone-/system-wide grants or checks.

Constant Summary

Constants inherited from Checkpoint::Resource

ALL

Instance Attribute Summary

Attributes inherited from Checkpoint::Resource

#entity

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Checkpoint::Resource

#==, all, #all_of_type, #eql?, #token

Constructor Details

#initializeAllOfAnyType

Create a wildcard Resource.

Because type and ID are static, this takes no parameters



11
12
13
# File 'lib/checkpoint/resource/all_of_any_type.rb', line 11

def initialize
  @entity = AnyEntity.new
end

Class Method Details

.from(_entity) ⇒ AllOfAnyType

Create a wildcard Resource “from” an entity. The entity disregarded and Checkpoint::Resource::AnyEntity is substituted.

Returns:



19
20
21
# File 'lib/checkpoint/resource/all_of_any_type.rb', line 19

def self.from(_entity)
  new
end

Instance Method Details

#idObject

The special ALL id



29
30
31
# File 'lib/checkpoint/resource/all_of_any_type.rb', line 29

def id
  Resource::ALL
end

#typeObject

The special ALL type



24
25
26
# File 'lib/checkpoint/resource/all_of_any_type.rb', line 24

def type
  Resource::ALL
end