Class: LdapConverters::ArrayValue

Inherits:
Base
  • Object
show all
Defined in:
lib/ldap_converters.rb

Overview

Force LDAP value to be an Array

Direct Known Subclasses

ArrayOfJSON

Instance Attribute Summary

Attributes inherited from Base

#model

Instance Method Summary (collapse)

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from LdapConverters::Base

Instance Method Details

- (Object) read(v)



56
57
58
# File 'lib/ldap_converters.rb', line 56

def read(v)
  Array(v)
end

- (Object) validate(v)



62
63
64
65
66
67
68
# File 'lib/ldap_converters.rb', line 62

def validate(v)
  return if v.kind_of?(Array)
  return {
    :code => :invalid_type,
    :message => "Value must be Array like not #{ v.class.name }"
  }
end

- (Object) write(v)



59
60
61
# File 'lib/ldap_converters.rb', line 59

def write(v)
  Array(v)
end