module UCB::LDAP::Schema

UCB::LDAP::Schema

Class responsible for getting schema information for all of the UCB::LDAP entities. Attributes are modeled as instances of UCB::LDAP::Schema::Attribute.

Each entity (Person, Org, etc.) has a Hash of attributes where the keys are canonical (see Entry.canonical) attribute/alias names and the values are Schema::Attribute's.

You don't have to explicitly load schema information; the UCB::LDAP module loads schema information as needed. Unless you want to override the schema url (or file) you probably won't need to work directly with this class.

Schema Source

Schema information is loaded from a url defined by the SCHEMA_* constants. A version of the file is distributed with this Gem and is used in case the web version is not accessible.

Constants

SCHEMA_BASE_URL
SCHEMA_CONTENT_PATH
SCHEMA_FILE

Public Class Methods

schema_base_url() click to toggle source

Returns schema base url. Defaults to SCHEMA_BASE_URL constant.

# File lib/ucb_ldap/schema.rb, line 42
def schema_base_url
  @schema_base_url || SCHEMA_BASE_URL
end
schema_base_url=(base_url) click to toggle source

Setter for schema_base_url(). Use this to override url of LDAP schema information.

# File lib/ucb_ldap/schema.rb, line 48
def schema_base_url=(base_url)
  @schema_base_url = base_url
end
schema_content_path() click to toggle source

Returns schema content path. Defaults to SCHEMA_CONTENT_PATH constant.

# File lib/ucb_ldap/schema.rb, line 53
def schema_content_path
  @schema_content_path || SCHEMA_CONTENT_PATH
end
schema_content_path=(content_path) click to toggle source

Setter for schema_content_path(). Use this to override content path of LDAP schema information.

# File lib/ucb_ldap/schema.rb, line 59
def schema_content_path=(content_path)
  @schema_content_path = content_path
end
schema_file() click to toggle source

Returns schema file. Defaults fo SCHEMA_FILE constant.

# File lib/ucb_ldap/schema.rb, line 64
def schema_file
  @schema_file || SCHEMA_FILE
end
schema_file=(file) click to toggle source

Setter for schema_file(). Use this to override location of local schema file.

# File lib/ucb_ldap/schema.rb, line 70
def schema_file=(file)
  @schema_file = file
end
schema_hash() click to toggle source

Returns a hash of all attributes for all entities. Keys are entity names, values hash of attributes for given entity.

# File lib/ucb_ldap/schema.rb, line 37
def schema_hash()
  @schema_hash ||= load_attributes
end