Class: AD::RecordFinder
- Inherits:
-
Object
- Object
- AD::RecordFinder
- Defined in:
- lib/ad/record_finder.rb
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
- #find_by_id(query) ⇒ Object
-
#initialize(connection = AD::ConnectionFactory.service_user_connection) ⇒ RecordFinder
constructor
A new instance of RecordFinder.
Constructor Details
#initialize(connection = AD::ConnectionFactory.service_user_connection) ⇒ RecordFinder
Returns a new instance of RecordFinder.
5 6 7 |
# File 'lib/ad/record_finder.rb', line 5 def initialize(connection = AD::ConnectionFactory.service_user_connection) @connection = connection end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
9 10 11 |
# File 'lib/ad/record_finder.rb', line 9 def connection @connection end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
9 10 11 |
# File 'lib/ad/record_finder.rb', line 9 def result @result end |
Instance Method Details
#find_by_id(query) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/ad/record_finder.rb', line 11 def find_by_id(query) @result = @connection.search( base: AD.base_dn, filter: Net::LDAP::Filter.eq(AD.unique_id_attr, query.to_s) ) end |