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.



246
247
248
249
250
251
252
253
# File 'lib/active_ldap/schema.rb', line 246

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.



245
246
247
# File 'lib/active_ldap/schema.rb', line 245

def aliases
  @aliases
end

#descriptionObject (readonly)

Returns the value of attribute description.



245
246
247
# File 'lib/active_ldap/schema.rb', line 245

def description
  @description
end

#idObject (readonly)

Returns the value of attribute id.



245
246
247
# File 'lib/active_ldap/schema.rb', line 245

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



245
246
247
# File 'lib/active_ldap/schema.rb', line 245

def name
  @name
end

Instance Method Details

#<=>(other) ⇒ Object



264
265
266
# File 'lib/active_ldap/schema.rb', line 264

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

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


255
256
257
258
# File 'lib/active_ldap/schema.rb', line 255

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

#hashObject



260
261
262
# File 'lib/active_ldap/schema.rb', line 260

def hash
  id.hash
end