Sha256: 3e6832e7c7e16037a2dc99613e33f144d86f0c365aed4f12ee68d14488787f83

Contents?: true

Size: 549 Bytes

Versions: 14

Compression:

Stored size: 549 Bytes

Contents

module ActiveLdap
  module AttributeMethods
    module BeforeTypeCast
      extend ActiveSupport::Concern

      included do
        attribute_method_suffix '_before_type_cast'
      end

    protected
      def attribute_before_type_cast(attr)
        get_attribute_before_type_cast(attr)[1]
      end

      def get_attribute_before_type_cast(name, force_array=false)
        name = to_real_attribute_name(name)

        value = @data[name]
        value = [] if value.nil?
        [name, array_of(value, force_array)]
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
activeldap-5.1.1 lib/active_ldap/attribute_methods/before_type_cast.rb
activeldap-5.1.0 lib/active_ldap/attribute_methods/before_type_cast.rb
activeldap-3.2.3 lib/active_ldap/attribute_methods/before_type_cast.rb
powerhome-activeldap-3.2.3 lib/active_ldap/attribute_methods/before_type_cast.rb
activeldap-4.0.6 lib/active_ldap/attribute_methods/before_type_cast.rb
activeldap-4.0.5 lib/active_ldap/attribute_methods/before_type_cast.rb
activeldap-4.0.4 lib/active_ldap/attribute_methods/before_type_cast.rb
activeldap-4.0.3 lib/active_ldap/attribute_methods/before_type_cast.rb
activeldap-4.0.2 lib/active_ldap/attribute_methods/before_type_cast.rb
activeldap-4.0.1 lib/active_ldap/attribute_methods/before_type_cast.rb
activeldap-4.0.0 lib/active_ldap/attribute_methods/before_type_cast.rb
activeldap-3.2.2 lib/active_ldap/attribute_methods/before_type_cast.rb
activeldap-3.2.1 lib/active_ldap/attribute_methods/before_type_cast.rb
activeldap-3.2.0 lib/active_ldap/attribute_methods/before_type_cast.rb