Sha256: 5bc15866f6b0bd2fe134bae49d5f44e52dd228ee24d83136e5904416dd622a1d

Contents?: true

Size: 475 Bytes

Versions: 8

Compression:

Stored size: 475 Bytes

Contents

module Mobility
=begin

Module loading Sequel-specific classes for Mobility models.

=end
  module Sequel
    def self.included(model_class)
      model_class.extend DatasetMethod.new(Mobility.query_method)
    end

    class DatasetMethod < Module
      def initialize(query_method)
        module_eval <<-EOM, __FILE__, __LINE__ + 1
          def #{query_method}
            dataset
          end
        EOM
      end
    end
    private_constant :DatasetMethod
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mobility-0.7.6 lib/mobility/sequel.rb
mobility-0.7.5 lib/mobility/sequel.rb
mobility-0.7.4 lib/mobility/sequel.rb
mobility-0.7.3 lib/mobility/sequel.rb
mobility-0.7.2 lib/mobility/sequel.rb
mobility-0.7.1 lib/mobility/sequel.rb
mobility-0.7.0 lib/mobility/sequel.rb
mobility-0.6.0 lib/mobility/sequel.rb