Module: LdapConverters

Defined in:
lib/ldap_converters.rb

Defined Under Namespace

Classes: ArrayOfJSON, ArrayValue, Base, Number, SingleValue, StringBoolean

Class Method Summary (collapse)

Class Method Details

+ (Object) json

Deprecated.

Use ArrayOfJSON instead.



129
130
131
132
133
134
135
136
137
138
139
# File 'lib/ldap_converters.rb', line 129

def self.json
  lambda do |networks|
    Array(networks).map do |n|
      begin
        JSON.parse(n)
      rescue JSON::ParserError
        # Legacy data is not JSON. Just ignore...
      end
    end.compact
  end
end

+ (Object) parse_wlan

Deprecated.

Use ArrayOfJSON instead.



142
143
144
# File 'lib/ldap_converters.rb', line 142

def self.parse_wlan
  json
end

+ (Object) string_boolean

Deprecated.

Use StringBoolean instead.



115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/ldap_converters.rb', line 115

def self.string_boolean
  lambda do |value|
    case Array(value).first
    when "TRUE"
      true
    when "FALSE"
      false
    else
      nil
    end
  end
end