Class: RealDataTests::SqlDumpParser::SqlBlock

Inherits:
Object
  • Object
show all
Defined in:
lib/real_data_tests/sql_dump_parser.rb

Overview

A single parsed block of the dump, tagged with its statement type.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content) ⇒ SqlBlock

Returns a new instance of SqlBlock.



59
60
61
62
63
# File 'lib/real_data_tests/sql_dump_parser.rb', line 59

def initialize(content)
  @content = content.strip
  @type = determine_block_type
  @table_name = extract_table_name if @type == :insert
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



57
58
59
# File 'lib/real_data_tests/sql_dump_parser.rb', line 57

def content
  @content
end

#table_nameObject (readonly)

Returns the value of attribute table_name.



57
58
59
# File 'lib/real_data_tests/sql_dump_parser.rb', line 57

def table_name
  @table_name
end

#typeObject (readonly)

Returns the value of attribute type.



57
58
59
# File 'lib/real_data_tests/sql_dump_parser.rb', line 57

def type
  @type
end