Class: PolicyMachineStorageAdapter::InMemory::PersistedPolicyElement
- Inherits:
-
Object
- Object
- PolicyMachineStorageAdapter::InMemory::PersistedPolicyElement
- Defined in:
- lib/policy_machine_storage_adapters/in_memory.rb
Overview
Class to represent policy elements
Instance Attribute Summary collapse
-
#extra_attributes ⇒ Object
readonly
Returns the value of attribute extra_attributes.
-
#pe_type ⇒ Object
readonly
Returns the value of attribute pe_type.
-
#persisted ⇒ Object
Returns the value of attribute persisted.
-
#policy_machine_uuid ⇒ Object
readonly
Returns the value of attribute policy_machine_uuid.
-
#unique_identifier ⇒ Object
readonly
Returns the value of attribute unique_identifier.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(unique_identifier, policy_machine_uuid, pe_type, extra_attributes) ⇒ PersistedPolicyElement
constructor
Ensure that attr keys are strings.
Constructor Details
#initialize(unique_identifier, policy_machine_uuid, pe_type, extra_attributes) ⇒ PersistedPolicyElement
Ensure that attr keys are strings
246 247 248 249 250 251 252 253 254 255 |
# File 'lib/policy_machine_storage_adapters/in_memory.rb', line 246 def initialize(unique_identifier, policy_machine_uuid, pe_type, extra_attributes) @unique_identifier = unique_identifier @policy_machine_uuid = policy_machine_uuid @pe_type = pe_type @persisted = false @extra_attributes = extra_attributes extra_attributes.each do |key, value| define_singleton_method key, lambda {@extra_attributes[key]} end end |
Instance Attribute Details
#extra_attributes ⇒ Object (readonly)
Returns the value of attribute extra_attributes.
243 244 245 |
# File 'lib/policy_machine_storage_adapters/in_memory.rb', line 243 def extra_attributes @extra_attributes end |
#pe_type ⇒ Object (readonly)
Returns the value of attribute pe_type.
243 244 245 |
# File 'lib/policy_machine_storage_adapters/in_memory.rb', line 243 def pe_type @pe_type end |
#persisted ⇒ Object
Returns the value of attribute persisted.
242 243 244 |
# File 'lib/policy_machine_storage_adapters/in_memory.rb', line 242 def persisted @persisted end |
#policy_machine_uuid ⇒ Object (readonly)
Returns the value of attribute policy_machine_uuid.
243 244 245 |
# File 'lib/policy_machine_storage_adapters/in_memory.rb', line 243 def policy_machine_uuid @policy_machine_uuid end |
#unique_identifier ⇒ Object (readonly)
Returns the value of attribute unique_identifier.
243 244 245 |
# File 'lib/policy_machine_storage_adapters/in_memory.rb', line 243 def unique_identifier @unique_identifier end |
Instance Method Details
#==(other) ⇒ Object
257 258 259 260 261 262 |
# File 'lib/policy_machine_storage_adapters/in_memory.rb', line 257 def ==(other) return false unless other.is_a?(PersistedPolicyElement) self.unique_identifier == other.unique_identifier && self.policy_machine_uuid == other.policy_machine_uuid && self.pe_type == other.pe_type end |