Class: AD::Framework::Config
- Inherits:
-
Object
- Object
- AD::Framework::Config
- Defined in:
- lib/ad-framework/config.rb,
lib/ad-framework/config/mapping.rb,
lib/ad-framework/config/attribute_definition.rb
Defined Under Namespace
Classes: AttributeDefinition, Mapping
Instance Attribute Summary collapse
-
#attribute_types ⇒ Object
Returns the value of attribute attribute_types.
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#ldap_prefix ⇒ Object
Returns the value of attribute ldap_prefix.
-
#object_classes ⇒ Object
Returns the value of attribute object_classes.
Instance Method Summary collapse
- #add_attribute(attribute) ⇒ Object
- #add_attribute_type(attribute_type) ⇒ Object
- #add_object_class(object_class) ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #ldap(&block) ⇒ Object (also: #adapter)
- #logger ⇒ Object
- #logger=(new_logger) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
12 13 14 15 16 17 18 19 |
# File 'lib/ad-framework/config.rb', line 12 def initialize self.mappings = AD::Framework::Config::Mapping.new self.mappings.add(:dn, "distinguishedname") self.attributes = AD::Framework::Config::Mapping.new self.attribute_types = AD::Framework::Config::Mapping.new self.object_classes = AD::Framework::Config::Mapping.new end |
Instance Attribute Details
#attribute_types ⇒ Object
Returns the value of attribute attribute_types.
10 11 12 |
# File 'lib/ad-framework/config.rb', line 10 def attribute_types @attribute_types end |
#attributes ⇒ Object
Returns the value of attribute attributes.
10 11 12 |
# File 'lib/ad-framework/config.rb', line 10 def attributes @attributes end |
#ldap_prefix ⇒ Object
Returns the value of attribute ldap_prefix.
10 11 12 |
# File 'lib/ad-framework/config.rb', line 10 def ldap_prefix @ldap_prefix end |
#object_classes ⇒ Object
Returns the value of attribute object_classes.
10 11 12 |
# File 'lib/ad-framework/config.rb', line 10 def object_classes @object_classes end |
Instance Method Details
#add_attribute(attribute) ⇒ Object
57 58 59 60 61 |
# File 'lib/ad-framework/config.rb', line 57 def add_attribute(attribute) definition = AD::Framework::Config::AttributeDefinition.new(attribute) self.mappings.add(definition.name, definition.ldap_name) self.attributes.add(definition.name, definition) end |
#add_attribute_type(attribute_type) ⇒ Object
62 63 64 |
# File 'lib/ad-framework/config.rb', line 62 def add_attribute_type(attribute_type) self.attribute_types.add(attribute_type.key, attribute_type) end |
#add_object_class(object_class) ⇒ Object
65 66 67 |
# File 'lib/ad-framework/config.rb', line 65 def add_object_class(object_class) self.object_classes.add(object_class.ldap_name, object_class) end |
#ldap(&block) ⇒ Object Also known as: adapter
29 30 31 32 33 34 |
# File 'lib/ad-framework/config.rb', line 29 def ldap(&block) if block AD::LDAP.configure(&block) end AD::LDAP end |
#logger ⇒ Object
37 38 39 |
# File 'lib/ad-framework/config.rb', line 37 def logger self.adapter.logger end |
#logger=(new_logger) ⇒ Object
40 41 42 |
# File 'lib/ad-framework/config.rb', line 40 def logger=(new_logger) self.adapter.config.logger = new_logger end |