Class: Cmap::GraphToSql
- Inherits:
-
Object
- Object
- Cmap::GraphToSql
- Defined in:
- lib/cmap/graph_to_sql.rb
Instance Attribute Summary collapse
-
#column_gsubs ⇒ Object
readonly
Returns the value of attribute column_gsubs.
-
#graph ⇒ Object
readonly
Returns the value of attribute graph.
-
#query_gsubs ⇒ Object
readonly
Returns the value of attribute query_gsubs.
-
#table_name ⇒ Object
readonly
Returns the value of attribute table_name.
Instance Method Summary collapse
-
#initialize(table_name, graph, query_gsubs = [], column_gsubs = []) ⇒ GraphToSql
constructor
A new instance of GraphToSql.
- #queries ⇒ Object
Constructor Details
#initialize(table_name, graph, query_gsubs = [], column_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, graph, query_gsubs = [], column_gsubs = []) @table_name = table_name @graph = graph @query_gsubs = query_gsubs @column_gsubs = column_gsubs end |
Instance Attribute Details
#column_gsubs ⇒ Object (readonly)
Returns the value of attribute column_gsubs.
3 4 5 |
# File 'lib/cmap/graph_to_sql.rb', line 3 def column_gsubs @column_gsubs end |
#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 |
#query_gsubs ⇒ Object (readonly)
Returns the value of attribute query_gsubs.
3 4 5 |
# File 'lib/cmap/graph_to_sql.rb', line 3 def query_gsubs @query_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 edges.inject([]) do |memo, edge| memo.push(edge_to_query(edge)) memo end end |