Class: RDBI::Driver::Mock::DBH

Inherits:
RDBI::Database
  • Object
show all
Defined in:
lib/rdbi/driver/mock.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#next_actionObject

Returns the value of attribute next_action.



44
45
46
# File 'lib/rdbi/driver/mock.rb', line 44

def next_action
  @next_action
end

Instance Method Details

#commit(*args) ⇒ Object

XXX more methods to be defined this way.



60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/rdbi/driver/mock.rb', line 60

def commit(*args)
  super(*args)

  ret = nil

  if next_action
    ret = next_action.call(*args)
    self.next_action = nil
  end

  ret
end

#new_statement(query) ⇒ Object



46
47
48
# File 'lib/rdbi/driver/mock.rb', line 46

def new_statement(query)
  Mock::STH.new(query, self)
end

#pingObject



50
51
52
# File 'lib/rdbi/driver/mock.rb', line 50

def ping
  connected? ? 10 : nil
end

#rollbackObject



54
55
56
57
# File 'lib/rdbi/driver/mock.rb', line 54

def rollback
  super();
  "rollback called"
end