Class: ActiveLdap::Ldif::ModifyRecord — activeldap - ActiveLdap

Class: ActiveLdap::Ldif::ModifyRecord

Inherits:
ChangeRecord show all
Includes:
Enumerable
Defined in:
lib/active_ldap/ldif.rb

Defined Under Namespace

Classes: AddOperation, DeleteOperation, Operation, ReplaceOperation

Instance Attribute Summary (collapse)

Attributes inherited from ChangeRecord

#change_type, #controls

Attributes inherited from Record

#attributes, #dn

Instance Method Summary (collapse)

Methods inherited from ChangeRecord

#add?, #delete?, #modify?, #modify_dn?, #modify_rdn?

Methods inherited from Record

#to_hash, #to_s

Constructor Details

- (ModifyRecord) initialize(dn, controls = [], operations = [])

Returns a new instance of ModifyRecord



838
839
840
841
# File 'lib/active_ldap/ldif.rb', line 838

def initialize(dn, controls=[], operations=[])
  super(dn, {}, controls, "modify")
  @operations = operations
end

Instance Attribute Details

- (Object) operations (readonly)

Returns the value of attribute operations



837
838
839
# File 'lib/active_ldap/ldif.rb', line 837

def operations
  @operations
end

Instance Method Details

- (Object) <<(operation)



847
848
849
# File 'lib/active_ldap/ldif.rb', line 847

def <<(operation)
  @operations << operation
end

- (Object) ==(other)



856
857
858
# File 'lib/active_ldap/ldif.rb', line 856

def ==(other)
  super(other) and @operations == other.operations
end

- (Object) add_operation(type, attribute, options, attributes)



851
852
853
854
# File 'lib/active_ldap/ldif.rb', line 851

def add_operation(type, attribute, options, attributes)
  klass = self.class.const_get("#{type.to_s.capitalize}Operation")
  self << klass.new(attribute, options, attributes)
end

- (Object) each(&block)



843
844
845
# File 'lib/active_ldap/ldif.rb', line 843

def each(&block)
  @operations.each(&block)
end