Class: Hoaxdb::Query
- Inherits:
-
Object
- Object
- Hoaxdb::Query
- Defined in:
- lib/hoaxdb/table.rb
Instance Method Summary collapse
Instance Method Details
#parse(query) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/hoaxdb/table.rb', line 6 def parse(query) query.strip! if query.match(/row\[|@data|@base|[^\>\<]=/) raise "This syntax is not allowed for querying" else if query.match(/this\[/) query = query.gsub(/this\[/,"row[") elsif query.eql? "*" query = "true" else raise "Unfamiliar query used" end end query end |
#parse_complex(query) ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/hoaxdb/table.rb', line 21 def parse_complex(query) query.strip! if query.match(/@data|@base|;|row/) raise "This syntax is not allowed for querying" else query = query.gsub(/this\[/,"row[") end query end |