Class: Clonk::Policy

Inherits:
Object
  • Object
show all
Defined in:
lib/clonk/policy.rb

Overview

Represents a policy in SSO. FIXME: Has not been fully updated from v1’s use of the API.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(policy_response) ⇒ Policy

Returns a new instance of Policy.



10
11
12
13
# File 'lib/clonk/policy.rb', line 10

def initialize(policy_response)
  @id = policy_response['id']
  @name = policy_response['name']
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



7
8
9
# File 'lib/clonk/policy.rb', line 7

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/clonk/policy.rb', line 8

def name
  @name
end

Class Method Details

.defaultsObject

Returns defaults for a policy. I’ve found no reason to override these, but then again, I’m not 100% sure how they work. Overrides will be added to necessary methods if requested.



19
20
21
22
23
24
# File 'lib/clonk/policy.rb', line 19

def self.defaults
  {
    logic: 'POSITIVE',
    decisionStrategy: 'UNANIMOUS'
  }
end