Sha256: 39a3a9d6034d4b47e115af4644d04144a7a9bce77b9ae856ca640b2cd66a2dcc

Contents?: true

Size: 565 Bytes

Versions: 14

Compression:

Stored size: 565 Bytes

Contents

# encoding: utf-8

module Rango
  module ORM
    class Datamapper
      def self.models
        klasses = Array.new
        ObjectSpace.each_object(Class) do |klass|
          klasses.push(klass) if klass.included_modules.include?(DataMapper::Resource)
        end
        klasses
      end

      def load
        Rango.dependency "dm-core", gem: true
        require_relative "support"
      end

      def connect
        try_connect do |adapter, database|
          DataMapper.setup(:default, "#{adapter}://#{database}")
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rango-0.1.1.2.10 lib/rango/orm/adapters/datamapper.rb
rango-0.1.1.2.9 lib/rango/orm/adapters/datamapper.rb
rango-0.1.1.2.8 lib/rango/orm/adapters/datamapper.rb
rango-0.1.1.2.7 lib/rango/orm/adapters/datamapper.rb
rango-0.1.1.2.6 lib/rango/orm/adapters/datamapper.rb
rango-0.1.1.2.5 lib/rango/orm/adapters/datamapper.rb
rango-0.1.1.2.4 lib/rango/orm/adapters/datamapper.rb
rango-0.1.1.2.3 lib/rango/orm/adapters/datamapper.rb
rango-0.1.1.2.2 lib/rango/orm/adapters/datamapper.rb
rango-0.1.1.2.1 lib/rango/orm/adapters/datamapper.rb
rango-0.1.1.2 lib/rango/orm/adapters/datamapper.rb
rango-0.1.1.1 lib/rango/orm/adapters/datamapper.rb
rango-0.1.1 lib/rango/orm/adapters/datamapper.rb
rango-0.1.0 lib/rango/orm/adapters/datamapper.rb