Class: GoodGuide::Gibbon::StaticClient

Inherits:
AbstractClient show all
Includes:
Util
Defined in:
lib/goodguide/gibbon.rb

Instance Method Summary collapse

Methods included from Util

#hash_to_js, #hash_to_ruby, #obj_to_ruby

Methods inherited from AbstractClient

queries, query

Instance Method Details

#analyze_query(input_id, query, t) ⇒ Object



208
209
210
211
212
213
# File 'lib/goodguide/gibbon.rb', line 208

def analyze_query(input_id, query, t)
  query_impl = get_query(query.type)
  analysis = instance_exec(input_id, obj_to_ruby(query.args), t, &query_impl)
  analysis[:annotations]['_query_type'] = query.type
  analysis
end

#query_error!(*a) ⇒ Object

Raises:



204
205
206
# File 'lib/goodguide/gibbon.rb', line 204

def query_error!(*a)
  raise QueryError.new(*a)
end

#to_jsObject



215
216
217
# File 'lib/goodguide/gibbon.rb', line 215

def to_js
  { :analyzeQuery => proc_for(:analyze_query) }
end