Exception: GoodGuide::Gibbon::MissingData

Inherits:
RuntimeError show all
Defined in:
lib/goodguide/gibbon.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, id, annotations) ⇒ MissingData



194
195
196
# File 'lib/goodguide/gibbon.rb', line 194

def initialize(type, id, annotations)
  @query_type, @id, @annotations = type, id, annotations
end

Instance Attribute Details

#annotationsObject

Returns the value of attribute annotations.



192
193
194
# File 'lib/goodguide/gibbon.rb', line 192

def annotations
  @annotations
end

#idObject (readonly)

Returns the value of attribute id.



192
193
194
# File 'lib/goodguide/gibbon.rb', line 192

def id
  @id
end

#query_typeObject (readonly)

Returns the value of attribute query_type.



192
193
194
# File 'lib/goodguide/gibbon.rb', line 192

def query_type
  @query_type
end

Instance Method Details

#as_jsonObject



202
203
204
205
206
207
208
209
# File 'lib/goodguide/gibbon.rb', line 202

def as_json(*)
  {
    'status' => 'missing_data',
    'query_type' => query_type,
    'entity_id' => id,
    'annotations' => annotations,
  }
end

#to_js(gibbon) ⇒ Object



198
199
200
# File 'lib/goodguide/gibbon.rb', line 198

def to_js(gibbon)
  gibbon['Failure'].query(@id, @annotations)
end