Sha256: 3bca231c162ff600107e629410893333fae78aad2bb153d816a58f31cf5c34fa
Contents?: true
Size: 1.15 KB
Versions: 1
Compression:
Stored size: 1.15 KB
Contents
module Aqua::Config def self.included( klass ) # This per aquatic class storage class is used to maintain the storage specific options, # such as a particular database for the class. Otherwise, appeals directly to Aqua::Storage # for class methods will loose database and other class specific storage options klass.class_eval " class Storage < Aqua::Storage end Storage.parent_class = '#{klass}' " klass.class_eval do extend ClassMethods configure_aqua hide_attributes :_aqua_opts end end module ClassMethods def configure_aqua(opts={}) database = opts.delete(:database) self::Storage.database = database @_aqua_opts = Mash.new( _aqua_opts ).merge!(opts) end def _aqua_opts @_aqua_opts ||= _aqua_config_defaults end private def _aqua_config_defaults { :database => nil, # Default is the same as the server. Everything is saved to the same db :embed => false, # options false, true, or :stub => [:attributes, :to_save, :in_the_other_object] } end public end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
aqua-0.2.0 | lib/aqua/object/config.rb |