Module: JunglePath::SQL::Helpers
- Defined in:
- lib/jungle_path/sql/helpers.rb
Class Method Summary collapse
Class Method Details
.get_count(db, sql, arg) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/jungle_path/sql/helpers.rb', line 4 def self.get_count(db, sql, arg) ds = db.base[sql, arg] result = ds.first puts "result: #{result}." count = result[:count].to_i end |
.sql(input) ⇒ Object
11 12 13 14 15 |
# File 'lib/jungle_path/sql/helpers.rb', line 11 def self.sql(input) a = input.split("\n") a = a.map {|s| s.strip} output = a.join("\n").strip end |