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

Class: ActiveLdap::Ldif::ModifyRecord::Operation

Inherits:
Object
  • Object
show all
Defined in:
lib/active_ldap/ldif.rb

Direct Known Subclasses

AddOperation, DeleteOperation, ReplaceOperation

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Operation) initialize(type, attribute, options, attributes)

Returns a new instance of Operation



872
873
874
875
876
877
# File 'lib/active_ldap/ldif.rb', line 872

def initialize(type, attribute, options, attributes)
  @type = type
  @attribute = attribute
  @options = options
  @attributes = attributes
end

Instance Attribute Details

- (Object) attribute (readonly)

Returns the value of attribute attribute



871
872
873
# File 'lib/active_ldap/ldif.rb', line 871

def attribute
  @attribute
end

- (Object) attributes (readonly)

Returns the value of attribute attributes



871
872
873
# File 'lib/active_ldap/ldif.rb', line 871

def attributes
  @attributes
end

- (Object) options (readonly)

Returns the value of attribute options



871
872
873
# File 'lib/active_ldap/ldif.rb', line 871

def options
  @options
end

- (Object) type (readonly)

Returns the value of attribute type



871
872
873
# File 'lib/active_ldap/ldif.rb', line 871

def type
  @type
end

Instance Method Details

- (Object) ==(other)



900
901
902
903
904
905
906
# File 'lib/active_ldap/ldif.rb', line 900

def ==(other)
  other.is_a?(self.class) and
    @type == other.type and
    full_attribute_name == other.full_attribute_name and
    Attributes.normalize(@attributes) ==
    Attributes.normalize(other.attributes)
end

- (Boolean) add?

Returns:

  • (Boolean)


883
884
885
# File 'lib/active_ldap/ldif.rb', line 883

def add?
  @type == "add"
end

- (Boolean) delete?

Returns:

  • (Boolean)


887
888
889
# File 'lib/active_ldap/ldif.rb', line 887

def delete?
  @type == "delete"
end

- (Object) full_attribute_name



879
880
881
# File 'lib/active_ldap/ldif.rb', line 879

def full_attribute_name
  [@attribute, *@options].join(";")
end

- (Boolean) replace?

Returns:

  • (Boolean)


891
892
893
# File 'lib/active_ldap/ldif.rb', line 891

def replace?
  @type == "replace"
end

- (Object) to_s



895
896
897
898
# File 'lib/active_ldap/ldif.rb', line 895

def to_s
  Attribute.encode(@type, full_attribute_name) +
    Attributes.encode(@attributes)
end