Sha256: e1c7edc9ff74f6741fae8781ee52f1d474343fad00e1f096139ef9c33a085fdf
Contents?: true
Size: 1.38 KB
Versions: 2
Compression:
Stored size: 1.38 KB
Contents
dir = File.dirname(__FILE__) require dir + '/pack' require dir + '/query' require dir + '/unpack' require dir + '/config' module Aqua::Tank def self.included( klass ) klass.class_eval do include Aqua::Pack include Aqua::Unpack include Aqua::Config include Aqua::Query end end end # Adds class method for declaring an object as Object.class_eval do # Used in class declarations to load an Aqua::Tank into the class, making it Aqua persistable # # @param [Hash] # @option opts [String] :database Database name to use # @option opts [true, false, Hash] :embed # True will embed the object in another when it appears in an instance variable # False will store it in its own document # When size 1 hash which :stub as the key. It will store the object separately, but save certain values into the object. # # @api public def self.aquatic( opts=nil ) include Aqua::Tank configure_aqua( opts ) if opts end # Returns true of false depending on whether the class has Aqua::Tank modules extended into it. # @return [true, false] # # @api public def self.aquatic? respond_to?( :configure_aqua ) end # Returns true of false depending on whether object instance has Aqua::Tank modules included. # @return [true, false] # # @api public def aquatic? self.class.aquatic? end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
baccigalupi-aqua-0.1.1 | lib/aqua/object/tank.rb |
baccigalupi-aqua-0.1.2 | lib/aqua/object/tank.rb |