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.
602 603 604 605 |
# File 'lib/active_ldap/ldif.rb', line 602 def initialize(records=[]) @version = 1 @records = records end |
Instance Attribute Details
#records ⇒ Object (readonly)
Returns the value of attribute records.
601 602 603 |
# File 'lib/active_ldap/ldif.rb', line 601 def records @records end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
601 602 603 |
# File 'lib/active_ldap/ldif.rb', line 601 def version @version end |
Class Method Details
Instance Method Details
#<<(record) ⇒ Object
607 608 609 |
# File 'lib/active_ldap/ldif.rb', line 607 def <<(record) @records << record end |
#==(other) ⇒ Object
623 624 625 626 |
# File 'lib/active_ldap/ldif.rb', line 623 def ==(other) other.is_a?(self.class) and @version == other.version and @records == other.records end |
#each(&block) ⇒ Object
611 612 613 |
# File 'lib/active_ldap/ldif.rb', line 611 def each(&block) @records.each(&block) end |
#to_s ⇒ Object
615 616 617 618 619 620 621 |
# File 'lib/active_ldap/ldif.rb', line 615 def to_s result = "version: #{@version}\n" result << @records.collect do |record| record.to_s end.join("\n") result end |