class ActiveLdap::Ldif::ChangeRecord::Control
def ==(other)
def ==(other) other.is_a?(self.class) and @type == other.type and @criticality = other.criticality and @value == other.value end
def criticality?
def criticality? @criticality end
def initialize(type, criticality, value)
def initialize(type, criticality, value) @type = type @criticality = normalize_criticality(criticality) @value = value end
def normalize_criticality(criticality)
def normalize_criticality(criticality) case criticality when "true", true true when "false", false false when nil nil else raise ArgumentError, _("invalid criticality value: %s") % criticality.inspect end end
def to_a
def to_a [@type, @criticality, @value] end
def to_hash
def to_hash { :type => @type, :criticality => @criticality, :value => @value, } end
def to_s
def to_s result = "control: #{@type}" result << " #{@criticality}" unless @criticality.nil? result << @value if @value result << "\n" result end