class ActiveLdap::Ldif::ChangeRecord::Control
Attributes
Public Class Methods
Source
# File lib/active_ldap/ldif.rb, line 724 def initialize(type, criticality, value) @type = type @criticality = normalize_criticality(criticality) @value = value end
Public Instance Methods
Source
# File lib/active_ldap/ldif.rb, line 754 def ==(other) other.is_a?(self.class) and @type == other.type and @criticality = other.criticality and @value == other.value end
Source
# File lib/active_ldap/ldif.rb, line 738 def to_hash { :type => @type, :criticality => @criticality, :value => @value, } end
Source
# File lib/active_ldap/ldif.rb, line 746 def to_s result = "control: #{@type}" result << " #{@criticality}" unless @criticality.nil? result << @value if @value result << "\n" result end
Private Instance Methods
Source
# File lib/active_ldap/ldif.rb, line 762 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