Class: ConsulToken
- Inherits:
-
Object
- Object
- ConsulToken
- Defined in:
- lib/puppet/provider/consul_token/default.rb
Instance Attribute Summary collapse
-
#accessor_id ⇒ Object
readonly
Returns the value of attribute accessor_id.
-
#description ⇒ Object
Returns the value of attribute description.
-
#policies ⇒ Object
Returns the value of attribute policies.
-
#secret_id ⇒ Object
readonly
Returns the value of attribute secret_id.
Instance Method Summary collapse
-
#initialize(accessor_id, secret_id, description, policies) ⇒ ConsulToken
constructor
A new instance of ConsulToken.
- #is_policy_list_equal(policies_by_id, policies_by_name) ⇒ Object
Constructor Details
#initialize(accessor_id, secret_id, description, policies) ⇒ ConsulToken
Returns a new instance of ConsulToken.
98 99 100 101 102 103 |
# File 'lib/puppet/provider/consul_token/default.rb', line 98 def initialize(accessor_id, secret_id, description, policies) @accessor_id = accessor_id @secret_id = secret_id @description = description @policies = policies end |
Instance Attribute Details
#accessor_id ⇒ Object (readonly)
Returns the value of attribute accessor_id.
96 97 98 |
# File 'lib/puppet/provider/consul_token/default.rb', line 96 def accessor_id @accessor_id end |
#description ⇒ Object
Returns the value of attribute description.
95 96 97 |
# File 'lib/puppet/provider/consul_token/default.rb', line 95 def description @description end |
#policies ⇒ Object
Returns the value of attribute policies.
95 96 97 |
# File 'lib/puppet/provider/consul_token/default.rb', line 95 def policies @policies end |
#secret_id ⇒ Object (readonly)
Returns the value of attribute secret_id.
96 97 98 |
# File 'lib/puppet/provider/consul_token/default.rb', line 96 def secret_id @secret_id end |
Instance Method Details
#is_policy_list_equal(policies_by_id, policies_by_name) ⇒ Object
105 106 107 108 109 110 111 112 113 |
# File 'lib/puppet/provider/consul_token/default.rb', line 105 def is_policy_list_equal(policies_by_id, policies_by_name) total_length = (policies_by_id.length + policies_by_name.length) return false if @policies.length != total_length actual_policies_by_id = @policies.map(&:policy_id) actual_policies_by_name = @policies.map(&:policy_name) (policies_by_id - actual_policies_by_id).empty? && (policies_by_name - actual_policies_by_name).empty? end |