class PM::Operation

An operation set in a policy machine.

Public Class Methods

all(pm_storage_adapter, options = {}) click to toggle source

Return all policy elements of a particular type (e.g. all users)

# File lib/policy_machine/policy_element.rb, line 238
def self.all(pm_storage_adapter, options = {})
  pm_storage_adapter.find_all_of_type_operation(options).map do |stored_pe|
    convert_stored_pe_to_pe(stored_pe, pm_storage_adapter, PM::Operation)
  end
end
create(unique_identifier, policy_machine_uuid, pm_storage_adapter, extra_attributes = {}) click to toggle source
# File lib/policy_machine/policy_element.rb, line 231
def self.create(unique_identifier, policy_machine_uuid, pm_storage_adapter, extra_attributes = {})
  new_pe = new(unique_identifier, policy_machine_uuid, pm_storage_adapter, nil, extra_attributes)
  new_pe.stored_pe = pm_storage_adapter.add_operation(unique_identifier, policy_machine_uuid, extra_attributes)
  new_pe
end

Public Instance Methods

associations() click to toggle source

Return all associations in which this Operation is included Associations are arrays of PM::Attributes.

# File lib/policy_machine/policy_element.rb, line 247
def associations
  @pm_storage_adapter.associations_with(self.stored_pe).map do |assoc|
    PM::Association.new(assoc[0], assoc[1], assoc[2], @pm_storage_adapter)
  end
end

Protected Instance Methods

allowed_assignee_classes() click to toggle source
# File lib/policy_machine/policy_element.rb, line 254
def allowed_assignee_classes
  []
end