Class: ActiveLdap::Ldif::Record

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

Direct Known Subclasses

ChangeRecord, ContentRecord

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from GetTextSupport

included

Constructor Details

#initialize(dn, attributes) ⇒ Record

Returns a new instance of Record.



604
605
606
607
# File 'lib/active_ldap/ldif.rb', line 604

def initialize(dn, attributes)
  @dn = dn
  @attributes = attributes
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



603
604
605
# File 'lib/active_ldap/ldif.rb', line 603

def attributes
  @attributes
end

#dnObject (readonly)

Returns the value of attribute dn.



603
604
605
# File 'lib/active_ldap/ldif.rb', line 603

def dn
  @dn
end

Instance Method Details

#==(other) ⇒ Object



619
620
621
622
623
624
# File 'lib/active_ldap/ldif.rb', line 619

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

#to_hashObject



609
610
611
# File 'lib/active_ldap/ldif.rb', line 609

def to_hash
  attributes.merge({"dn" => dn})
end

#to_sObject



613
614
615
616
617
# File 'lib/active_ldap/ldif.rb', line 613

def to_s
  result = to_s_prelude
  result << to_s_content
  result
end