# class ActiveLdap::Ldif::ChangeRecord::Control

### Attributes

type[R]
value[R]

### Public Class Methods

new(type, criticality, value) click to toggle source

    # File lib/active_ldap/ldif.rb, line 718
    def initialize(type, criticality, value)
      @type = type
      @criticality = normalize_criticality(criticality)
      @value = value
    end

### Public Instance Methods

==(other) click to toggle source

    # 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

criticality?() click to toggle source

    # File lib/active_ldap/ldif.rb, line 724
    def criticality?
      @criticality
    end

to_a() click to toggle source

    # File lib/active_ldap/ldif.rb, line 728
    def to_a
      [@type, @criticality, @value]
    end

to_hash() click to toggle source

    # File lib/active_ldap/ldif.rb, line 732
    def to_hash
      {
        :type => @type,
        :criticality => @criticality,
        :value => @value,
      }
    end

to_s() click to toggle source

    # 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

### Private Instance Methods

normalize_criticality(criticality) click to toggle source

    # File lib/active_ldap/ldif.rb, line 756
    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