Class: ActiveLdap::Schema::Entry

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/active_ldap/schema.rb

Direct Known Subclasses

Attribute, ObjectClass, Syntax

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, schema, group) ⇒ Entry

Returns a new instance of Entry.



285
286
287
288
289
290
291
292
# File 'lib/active_ldap/schema.rb', line 285

def initialize(name, schema, group)
  @schema = schema
  @name, *@aliases = attribute("NAME", name)
  @name ||= name
  @id = @schema.resolve_name(group, @name)
  collect_info
  @schema = nil
end

Instance Attribute Details

#aliasesObject (readonly)

Returns the value of attribute aliases.



284
285
286
# File 'lib/active_ldap/schema.rb', line 284

def aliases
  @aliases
end

#descriptionObject (readonly)

Returns the value of attribute description.



284
285
286
# File 'lib/active_ldap/schema.rb', line 284

def description
  @description
end

#idObject (readonly)

Returns the value of attribute id.



284
285
286
# File 'lib/active_ldap/schema.rb', line 284

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



284
285
286
# File 'lib/active_ldap/schema.rb', line 284

def name
  @name
end

Instance Method Details

#<=>(other) ⇒ Object



304
305
306
# File 'lib/active_ldap/schema.rb', line 304

def <=>(other)
  name <=> other.name
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


294
295
296
297
298
# File 'lib/active_ldap/schema.rb', line 294

def eql?(other)
  self.class == other.class and
    (id == other.id or
     (id.nil? and other.nil? and name == other.name))
end

#hashObject



300
301
302
# File 'lib/active_ldap/schema.rb', line 300

def hash
  id.nil? ? name.hash : id.hash
end

#to_paramObject



308
309
310
# File 'lib/active_ldap/schema.rb', line 308

def to_param
  name
end