Class: GoodGuide::Gibbon::RuntimeClient
Instance Method Summary
collapse
Methods included from Util
#hash_to_ruby, #obj_to_js, #obj_to_ruby
queries, query
Instance Method Details
#missing_data! ⇒ Object
368
369
370
|
# File 'lib/goodguide/gibbon.rb', line 368
def missing_data!
raise MissingData.new(@last_query_type, @last_id, @last_annotations)
end
|
355
356
357
358
359
360
361
362
363
364
365
366
|
# File 'lib/goodguide/gibbon.rb', line 355
def perform_query(id, annotations)
annotations = obj_to_ruby(annotations)
query_type = annotations.delete('_query_type')
@last_query_type = query_type
@last_annotations = annotations
@last_id = id
query = get_query(query_type) or raise "invalid query type in compiled code: #{query_type.inspect} with annotations #{annotations.inspect}"
instance_exec(id, annotations, &query)
end
|
#to_js(gibbon) ⇒ Object
372
373
374
|
# File 'lib/goodguide/gibbon.rb', line 372
def to_js(gibbon)
{ :performQuery => proc_for(gibbon, :perform_query) }
end
|