Class: ActiveLdap::Ldif
- Inherits:
-
Object
- Object
- ActiveLdap::Ldif
- Includes:
- Enumerable
- Defined in:
- lib/active_ldap/ldif.rb
Defined Under Namespace
Modules: Attribute, Attributes Classes: AddRecord, ChangeRecord, ContentRecord, DeleteRecord, ModifyDNRecord, ModifyNameRecord, ModifyRDNRecord, ModifyRecord, Parser, Record, Scanner
Instance Attribute Summary collapse
-
#records ⇒ Object
readonly
Returns the value of attribute records.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Class Method Summary collapse
Instance Method Summary collapse
- #<<(record) ⇒ Object
- #==(other) ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(records = []) ⇒ Ldif
constructor
A new instance of Ldif.
- #to_s ⇒ Object
Constructor Details
#initialize(records = []) ⇒ Ldif
Returns a new instance of Ldif.
608 609 610 611 |
# File 'lib/active_ldap/ldif.rb', line 608 def initialize(records=[]) @version = 1 @records = records end |
Instance Attribute Details
#records ⇒ Object (readonly)
Returns the value of attribute records.
607 608 609 |
# File 'lib/active_ldap/ldif.rb', line 607 def records @records end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
607 608 609 |
# File 'lib/active_ldap/ldif.rb', line 607 def version @version end |
Class Method Details
Instance Method Details
#<<(record) ⇒ Object
613 614 615 |
# File 'lib/active_ldap/ldif.rb', line 613 def <<(record) @records << record end |
#==(other) ⇒ Object
629 630 631 632 |
# File 'lib/active_ldap/ldif.rb', line 629 def ==(other) other.is_a?(self.class) and @version == other.version and @records == other.records end |
#each(&block) ⇒ Object
617 618 619 |
# File 'lib/active_ldap/ldif.rb', line 617 def each(&block) @records.each(&block) end |
#to_s ⇒ Object
621 622 623 624 625 626 627 |
# File 'lib/active_ldap/ldif.rb', line 621 def to_s result = "version: #{@version}\n" result << @records.collect do |record| record.to_s end.join("\n") result end |