class ActiveLdap::Schema::Syntax

Attributes

length[R]

Public Class Methods

new(id, schema) click to toggle source
# File lib/active_ldap/schema.rb, line 317
def initialize(id, schema)
  if %r\{(\d+)\}\z/ =~ id
    id = $PREMATCH
    @length = Integer($1)
  else
    @length = nil
  end
  super(id, schema, "ldapSyntaxes")
  @id = id
  @name = nil if @name == @id
  @validator = Syntaxes[@id]
end

Public Instance Methods

<=>(other) click to toggle source
# File lib/active_ldap/schema.rb, line 366
def <=>(other)
  id <=> other.id
end
binary_transfer_required?() click to toggle source
# File lib/active_ldap/schema.rb, line 330
def binary_transfer_required?
  @binary_transfer_required
end
human_readable?() click to toggle source
# File lib/active_ldap/schema.rb, line 334
def human_readable?
  @human_readable
end
normalize_value(value) click to toggle source
# File lib/active_ldap/schema.rb, line 358
def normalize_value(value)
  if @validator
    @validator.normalize_value(value)
  else
    value
  end
end
to_param() click to toggle source
# File lib/active_ldap/schema.rb, line 370
def to_param
  id
end
type_cast(value) click to toggle source
# File lib/active_ldap/schema.rb, line 350
def type_cast(value)
  if @validator
    @validator.type_cast(value)
  else
    value
  end
end
valid?(value) click to toggle source
# File lib/active_ldap/schema.rb, line 338
def valid?(value)
  validate(value).nil?
end
validate(value) click to toggle source
# File lib/active_ldap/schema.rb, line 342
def validate(value)
  if @validator
    @validator.validate(value)
  else
    nil
  end
end