Class: GoodGuide::Gibbon::RuntimeClient
Instance Method Summary
collapse
Methods included from Util
#hash_to_js, #hash_to_ruby, #obj_to_ruby
queries, query
Instance Method Details
#missing_data! ⇒ Object
258
259
260
|
# File 'lib/goodguide/gibbon.rb', line 258
def missing_data!
raise MissingData.new(@last_query_type, @last_id, @last_annotations)
end
|
244
245
246
247
248
249
250
251
252
253
254
255
256
|
# File 'lib/goodguide/gibbon.rb', line 244
def perform_query(id, annotations, v)
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)
instance_exec(id, annotations, v, &query)
end
|
#to_js ⇒ Object
262
263
264
|
# File 'lib/goodguide/gibbon.rb', line 262
def to_js
{ :performQuery => proc_for(:perform_query) }
end
|