Class: ActiveLdap::Ldif::ChangeRecord::Control — activeldap - ActiveLdap

Class: ActiveLdap::Ldif::ChangeRecord::Control

Inherits:
Object
  • Object
show all
Defined in:
lib/active_ldap/ldif.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Control) initialize(type, criticality, value)

Returns a new instance of Control



718
719
720
721
722
# File 'lib/active_ldap/ldif.rb', line 718

def initialize(type, criticality, value)
  @type = type
  @criticality = normalize_criticality(criticality)
  @value = value
end

Instance Attribute Details

- (Object) type (readonly)

Returns the value of attribute type



717
718
719
# File 'lib/active_ldap/ldif.rb', line 717

def type
  @type
end

- (Object) value (readonly)

Returns the value of attribute value



717
718
719
# File 'lib/active_ldap/ldif.rb', line 717

def value
  @value
end

Instance Method Details

- (Object) ==(other)



748
749
750
751
752
753
# File 'lib/active_ldap/ldif.rb', line 748

def ==(other)
  other.is_a?(self.class) and
    @type == other.type and
    @criticality = other.criticality and
    @value == other.value
end

- (Boolean) criticality?

Returns:

  • (Boolean)


724
725
726
# File 'lib/active_ldap/ldif.rb', line 724

def criticality?
  @criticality
end

- (Object) to_a



728
729
730
# File 'lib/active_ldap/ldif.rb', line 728

def to_a
  [@type, @criticality, @value]
end

- (Object) to_hash



732
733
734
735
736
737
738
# File 'lib/active_ldap/ldif.rb', line 732

def to_hash
  {
    :type => @type,
    :criticality => @criticality,
    :value => @value,
  }
end

- (Object) to_s



740
741
742
743
744
745
746
# File 'lib/active_ldap/ldif.rb', line 740

def to_s
  result = "control: #{@type}"
  result << " #{@criticality}" unless @criticality.nil?
  result << @value if @value
  result << "\n"
  result
end