Class: Databasedotcom::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/caviidae/databasedotcom/client.rb

Instance Method Summary collapse

Instance Method Details

#cleanupObject



17
18
19
20
21
22
23
# File 'lib/caviidae/databasedotcom/client.rb', line 17

def cleanup
  created.each do |sobject|
    sobject.delete
    sobject = nil
  end
  @created = []
end

#create(class_or_classname, object_attrs) ⇒ Object



7
8
9
10
11
# File 'lib/caviidae/databasedotcom/client.rb', line 7

def create(class_or_classname, object_attrs)
  new_object = original_create(class_or_classname, object_attrs)
  store(new_object)
  new_object
end

#createdObject



25
26
27
# File 'lib/caviidae/databasedotcom/client.rb', line 25

def created
  @created ||= []
end

#original_createObject



6
# File 'lib/caviidae/databasedotcom/client.rb', line 6

alias :original_create :create

#store(sobject) ⇒ Object



13
14
15
# File 'lib/caviidae/databasedotcom/client.rb', line 13

def store(sobject)
  created << sobject
end