Module: Armada

Defined in:
lib/armada/dirty.rb,
lib/armada/model.rb,
lib/armada/errors.rb,
lib/armada/observer.rb,
lib/armada/relation.rb,
lib/armada/callbacks.rb,
lib/armada/timestamp.rb,
lib/armada/connection.rb,
lib/armada/validations.rb,
lib/armada/finder_methods.rb,
lib/armada/database_methods.rb,
lib/armada/attribute_methods.rb

Defined Under Namespace

Modules: AttributeMethods, Callbacks, ClassMethods, DatabaseMethods, Dirty, FinderMethods, RelationMethods, Timestamp, Validations Classes: Connection, ConnectionError, Model, Observer, RecordNotFound, RecordNotSaved, Relation, ServerError

Class Method Summary collapse

Class Method Details

.compact!Object



38
39
40
# File 'lib/armada/connection.rb', line 38

def self.compact!
  query_if_connection("compact")
end

.explain(query) ⇒ Object



46
47
48
# File 'lib/armada/connection.rb', line 46

def self.explain(query)
  query_if_connection("explain", query)
end

.list_collectionsObject



42
43
44
# File 'lib/armada/connection.rb', line 42

def self.list_collections
  query_if_connection("list-collections")
end

.setup!(spec = {}) ⇒ Object



32
33
34
35
36
# File 'lib/armada/connection.rb', line 32

def self.setup!(spec = {})
  return @@connection if @@connection
  config = { address: "127.0.0.1", port: 3400 }.merge!(spec)
  @@connection = Connection.new(config[:address], config[:port], config[:password])
end