Class: Cmap::GraphToSql
- Inherits:
-
Object
- Object
- Cmap::GraphToSql
- Defined in:
- lib/cmap/graph_to_sql.rb
Instance Attribute Summary collapse
-
#graph ⇒ Object
readonly
Returns the value of attribute graph.
-
#schema_name ⇒ Object
readonly
Returns the value of attribute schema_name.
-
#subquery_gsubs ⇒ Object
readonly
Returns the value of attribute subquery_gsubs.
-
#table_name ⇒ Object
readonly
Returns the value of attribute table_name.
Instance Method Summary collapse
-
#initialize(table_name, schema_name, graph, subquery_gsubs = []) ⇒ GraphToSql
constructor
A new instance of GraphToSql.
- #queries ⇒ Object
Constructor Details
#initialize(table_name, schema_name, graph, subquery_gsubs = []) ⇒ GraphToSql
Returns a new instance of GraphToSql.
5 6 7 8 9 10 |
# File 'lib/cmap/graph_to_sql.rb', line 5 def initialize(table_name, schema_name, graph, subquery_gsubs = []) @table_name = table_name @schema_name = schema_name @graph = graph @subquery_gsubs = subquery_gsubs end |
Instance Attribute Details
#graph ⇒ Object (readonly)
Returns the value of attribute graph.
3 4 5 |
# File 'lib/cmap/graph_to_sql.rb', line 3 def graph @graph end |
#schema_name ⇒ Object (readonly)
Returns the value of attribute schema_name.
3 4 5 |
# File 'lib/cmap/graph_to_sql.rb', line 3 def schema_name @schema_name end |
#subquery_gsubs ⇒ Object (readonly)
Returns the value of attribute subquery_gsubs.
3 4 5 |
# File 'lib/cmap/graph_to_sql.rb', line 3 def subquery_gsubs @subquery_gsubs end |
#table_name ⇒ Object (readonly)
Returns the value of attribute table_name.
3 4 5 |
# File 'lib/cmap/graph_to_sql.rb', line 3 def table_name @table_name end |
Instance Method Details
#queries ⇒ Object
12 13 14 15 16 17 |
# File 'lib/cmap/graph_to_sql.rb', line 12 def queries sorted_grouped_edges.inject([]) do |memo, (_, edges)| memo += (EdgesToQueries.new(edges, table_name, schema_name, ).queries) memo end end |