class OrientSupport::Query

Public Class Methods

new(kind = '') click to toggle source

initialize with Query.new :s)elect, :t)raverse, :m)atch Query.new select: '', where: { a: 5 }

# File lib/support/query.rb, line 9
def initialize kind =  ''
@kind =       case kind.to_s[0]
        when 's'
                'SELECT'
        when 'm'
                'MATCH'
        when 't'
                'TRAVERSE'
        else
                ''
        end

end

Public Instance Methods

modify() { |c| ... } click to toggle source
# File lib/support/query.rb, line 24
def modify
    c = @uri.clone
    yield c
    Iri.new(c)
  end
modify_query() { |params| ... } click to toggle source
# File lib/support/query.rb, line 30
def modify_query
  modify do |c|
    params = CGI.parse(@uri.query || '').map { |p, a| [p.to_s, a.clone] }.to_h
    yield(params)
    c.query = URI.encode_www_form(params)
  end
end