Class: StickyElephant::PostgresSimulator

Inherits:
Object
  • Object
show all
Includes:
PostgresProtocol
Defined in:
lib/sticky_elephant/postgres_simulator.rb

Constant Summary

Constants included from PostgresProtocol

StickyElephant::PostgresProtocol::COMMAND_COMPLETE_COMMANDS, StickyElephant::PostgresProtocol::READY_FOR_QUERY_STATUSES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from PostgresProtocol

#command_complete, #data_row, #int16_bytes, #int32_bytes, #ready_for_query, #row_description, #with_length

Constructor Details

#initialize(query_string) ⇒ PostgresSimulator

Returns a new instance of PostgresSimulator.



7
8
9
10
# File 'lib/sticky_elephant/postgres_simulator.rb', line 7

def initialize(query_string)
  @query = normalize(query_string)
  simulate
end

Instance Attribute Details

#queryObject (readonly)

Returns the value of attribute query.



5
6
7
# File 'lib/sticky_elephant/postgres_simulator.rb', line 5

def query
  @query
end

#responseObject (readonly)

Returns the value of attribute response.



5
6
7
# File 'lib/sticky_elephant/postgres_simulator.rb', line 5

def response
  @response
end

Instance Method Details

#to_sObject



12
13
14
# File 'lib/sticky_elephant/postgres_simulator.rb', line 12

def to_s
  response
end