Class: Dock::Couchdb

Inherits:
Base
  • Object
show all
Defined in:
lib/dock/adapters/couchdb.rb

Instance Attribute Summary

Attributes inherited from Base

#model

Instance Method Summary collapse

Methods inherited from Base

#embedded, inherited, #initialize, #scoped

Constructor Details

This class inherits a constructor from Dock::Base

Instance Method Details

#all(options = {}) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/dock/adapters/couchdb.rb', line 14

def all(options = {})
    conditions, order, limit, offset = extract_conditions!(options)
    opts = { :conditions => conditions, :order => order_clause(order) }
    opts = opts.merge({ :limit => limit }) unless limit.nil?
    opts = opts.merge({ :offset => offset }) unless offset.nil?
    model.all opts
end

#associationsObject



35
36
37
# File 'lib/dock/adapters/couchdb.rb', line 35

def associations()

end

#belongs_toObject



51
52
53
# File 'lib/dock/adapters/couchdb.rb', line 51

def belongs_to()

end

#column_namesObject



41
42
43
# File 'lib/dock/adapters/couchdb.rb', line 41

def column_names()
  model.properties.map(&:name)
end

#count(options = {}) ⇒ Object

Checked



45
46
47
# File 'lib/dock/adapters/couchdb.rb', line 45

def count(options = {})
  all(options).count
end

#create(attributes = {}) ⇒ Object



5
6
7
# File 'lib/dock/adapters/couchdb.rb', line 5

def create(attributes = {})

end

#cyclic?Boolean

Returns:

  • (Boolean)


63
64
65
# File 'lib/dock/adapters/couchdb.rb', line 63

def cyclic?()
  
end

#destroy(object) ⇒ Object

2 zoo.attributes = { :name => ‘The Glue Factory’, :inception => Time.now } 3 zoo.save



32
33
34
# File 'lib/dock/adapters/couchdb.rb', line 32

def destroy(object)
    object.destroy if valid_object?(object)
end

#embedded?Boolean

Returns:

  • (Boolean)


60
61
62
# File 'lib/dock/adapters/couchdb.rb', line 60

def embedded?()

end

#encodingObject



48
49
50
# File 'lib/dock/adapters/couchdb.rb', line 48

def encoding()

end

#find(id) ⇒ Object



8
9
10
# File 'lib/dock/adapters/couchdb.rb', line 8

def find(id)

end

#find!(id) ⇒ Object



11
12
13
# File 'lib/dock/adapters/couchdb.rb', line 11

def find!(id)

end

#first(options = {}) ⇒ Object



21
22
23
24
# File 'lib/dock/adapters/couchdb.rb', line 21

def first(options = {})
  conditions, order = extract_conditions!(options)
  model.first :conditions => conditions, :order => order_clause(order)
end

#has_manyObject



54
55
56
# File 'lib/dock/adapters/couchdb.rb', line 54

def has_many()

end

#idObject



25
26
27
# File 'lib/dock/adapters/couchdb.rb', line 25

def id()

end

#model_nameObject



38
39
40
# File 'lib/dock/adapters/couchdb.rb', line 38

def model_name()
  model.class.name
end

#propertiesObject



69
70
71
# File 'lib/dock/adapters/couchdb.rb', line 69

def properties()

end

#scoped?Boolean

Returns:

  • (Boolean)


57
58
59
# File 'lib/dock/adapters/couchdb.rb', line 57

def scoped?()

end

#supports_joins?Boolean

Returns:

  • (Boolean)


66
67
68
# File 'lib/dock/adapters/couchdb.rb', line 66

def supports_joins?()
  false
end

#update(search_key, find_by, update_key, by_value) ⇒ Object



28
29
30
31
# File 'lib/dock/adapters/couchdb.rb', line 28

def update(search_key, find_by, update_key, by_value)
#2 zoo.attributes = { :name => 'The Glue Factory', :inception => Time.now }
#3 zoo.save
end