Sha256: 2893fb11cdc2e1043fa3edede3646898db1b7cbdd1f2d125a18866863f4fc8a5

Contents?: true

Size: 438 Bytes

Versions: 26

Compression:

Stored size: 438 Bytes

Contents

# frozen_string_literal: true

module Mobility
  module Sequel
=begin

Internal class used to initialize column value(s) by default to a hash.

=end
    class HashInitializer < Module
      def initialize(*columns)
        class_eval <<-EOM, __FILE__, __LINE__ + 1
          def initialize_set(values)
            #{columns.map { |c| "self[:#{c}] = {}" }.join(';')}
            super
          end
        EOM
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
mobility-1.0.0.beta2 lib/mobility/sequel/hash_initializer.rb
mobility-1.0.0.beta1 lib/mobility/sequel/hash_initializer.rb
mobility-1.0.0.alpha lib/mobility/sequel/hash_initializer.rb
mobility-0.8.13 lib/mobility/sequel/hash_initializer.rb
mobility-0.8.11 lib/mobility/sequel/hash_initializer.rb
mobility-0.8.10 lib/mobility/sequel/hash_initializer.rb
mobility-0.8.9 lib/mobility/sequel/hash_initializer.rb
mobility-0.8.8 lib/mobility/sequel/hash_initializer.rb
mobility-0.8.7 lib/mobility/sequel/hash_initializer.rb
mobility-0.8.6 lib/mobility/sequel/hash_initializer.rb
mobility-0.8.5 lib/mobility/sequel/hash_initializer.rb
mobility-0.8.4 lib/mobility/sequel/hash_initializer.rb
mobility-0.8.3 lib/mobility/sequel/hash_initializer.rb
mobility-0.8.2 lib/mobility/sequel/hash_initializer.rb
mobility-0.8.1 lib/mobility/sequel/hash_initializer.rb
mobility-0.8.0 lib/mobility/sequel/hash_initializer.rb
mobility-0.7.6 lib/mobility/sequel/hash_initializer.rb
mobility-0.7.5 lib/mobility/sequel/hash_initializer.rb
mobility-0.7.4 lib/mobility/sequel/hash_initializer.rb
mobility-0.7.3 lib/mobility/sequel/hash_initializer.rb