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
# File 'lib/cmap/propositions_to_sql.rb', line 5

def initialize(args)
  @propositions_path = args.fetch(:propositions_path)
  @table_name = args.fetch(:table_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

#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



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

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

#propositions_to_graphObject



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

def propositions_to_graph
  PropositionsToGraph.new(propositions_path)
end

#queriesObject



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

def queries
  graph_to_sql.queries
end

#raw_graphObject



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

def raw_graph
  propositions_to_graph.graph
end

#sanitized_graphObject



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

def sanitized_graph
  GraphSanitizer.new(raw_graph).sanitized_graph
end