Class: Cmap::PropositionsToSql

Inherits:
Object
  • Object
show all
Defined in:
lib/cmap/propositions_to_sql.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ PropositionsToSql

Returns a new instance of PropositionsToSql.



5
6
7
8
9
10
# File 'lib/cmap/propositions_to_sql.rb', line 5

def initialize(args)
  @propositions_path = args.fetch(:propositions_path)
  @table_name = args.fetch(:table_name)
  @schema_name = args.fetch(:schema_name)
  @subquery_gsubs = args.fetch(:subquery_gsubs, [])
end

Instance Attribute Details

#propositions_pathObject (readonly)

Returns the value of attribute propositions_path.



3
4
5
# File 'lib/cmap/propositions_to_sql.rb', line 3

def propositions_path
  @propositions_path
end

#schema_nameObject (readonly)

Returns the value of attribute schema_name.



3
4
5
# File 'lib/cmap/propositions_to_sql.rb', line 3

def schema_name
  @schema_name
end

#subquery_gsubsObject (readonly)

Returns the value of attribute subquery_gsubs.



3
4
5
# File 'lib/cmap/propositions_to_sql.rb', line 3

def subquery_gsubs
  @subquery_gsubs
end

#table_nameObject (readonly)

Returns the value of attribute table_name.



3
4
5
# File 'lib/cmap/propositions_to_sql.rb', line 3

def table_name
  @table_name
end

Instance Method Details

#graph_to_sqlObject



28
29
30
# File 'lib/cmap/propositions_to_sql.rb', line 28

def graph_to_sql
  GraphToSql.new(table_name, schema_name, sanitized_graph, subquery_gsubs)
end

#propositions_to_graphObject



16
17
18
# File 'lib/cmap/propositions_to_sql.rb', line 16

def propositions_to_graph
  PropositionsToGraph.new(propositions_path)
end

#queriesObject



12
13
14
# File 'lib/cmap/propositions_to_sql.rb', line 12

def queries
  graph_to_sql.queries
end

#raw_graphObject



20
21
22
# File 'lib/cmap/propositions_to_sql.rb', line 20

def raw_graph
  propositions_to_graph.graph
end

#sanitized_graphObject



24
25
26
# File 'lib/cmap/propositions_to_sql.rb', line 24

def sanitized_graph
  GraphSanitizer.new(raw_graph).sanitized_graph
end