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

Methods included from GetTextSupport

included

Constructor Details

#initialize(dn, controls = [], operations = []) ⇒ ModifyRecord

Returns a new instance of ModifyRecord.



810
811
812
813
# File 'lib/active_ldap/ldif.rb', line 810

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

Instance Attribute Details

#operationsObject (readonly)

Returns the value of attribute operations.



809
810
811
# File 'lib/active_ldap/ldif.rb', line 809

def operations
  @operations
end

Instance Method Details

#<<(operation) ⇒ Object



819
820
821
# File 'lib/active_ldap/ldif.rb', line 819

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

#==(other) ⇒ Object



828
829
830
# File 'lib/active_ldap/ldif.rb', line 828

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

#add_operation(type, attribute, options, attributes) ⇒ Object



823
824
825
826
# File 'lib/active_ldap/ldif.rb', line 823

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

#each(&block) ⇒ Object



815
816
817
# File 'lib/active_ldap/ldif.rb', line 815

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