class ActiveLdap::Ldif::ModifyRecord

Attributes

operations[R]

Public Class Methods

new(dn, controls=[], operations=[]) click to toggle source
Calls superclass method ActiveLdap::Ldif::ChangeRecord::new
# File lib/active_ldap/ldif.rb, line 838
def initialize(dn, controls=[], operations=[])
  super(dn, {}, controls, "modify")
  @operations = operations
end

Public Instance Methods

<<(operation) click to toggle source
# File lib/active_ldap/ldif.rb, line 847
def <<(operation)
  @operations << operation
end
==(other) click to toggle source
Calls superclass method ActiveLdap::Ldif::ChangeRecord#==
# File lib/active_ldap/ldif.rb, line 856
def ==(other)
  super(other) and @operations == other.operations
end
add_operation(type, attribute, options, attributes) click to toggle source
# 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
each(&block) click to toggle source
# File lib/active_ldap/ldif.rb, line 843
def each(&block)
  @operations.each(&block)
end

Private Instance Methods

to_s_content() click to toggle source
# File lib/active_ldap/ldif.rb, line 861
def to_s_content
  result = super
  return result if @operations.empty?
  @operations.collect do |operation|
    result << "#{operation}-\n"
  end
  result
end