Class: Leeno::Api::Canvas

Inherits:
Base
  • Object
show all
Defined in:
lib/leeno/api/canvas.rb

Constant Summary

Constants inherited from Base

Base::DOMAIN

Constants included from Leeno

VERSION

Class Method Summary collapse

Methods inherited from Base

get, model_class, request_index, request_index!, request_show, request_show!, result_set, result_set!, search_index, search_show, set_options!, success?

Class Method Details

.find(id, options = {}) ⇒ Object



3
4
5
6
# File 'lib/leeno/api/canvas.rb', line 3

def find id, options={}
  return nil if id.nil?
  search_show({canvas_id: id.to_s}.merge(options))
end

.find!(id, options = {}) ⇒ Object



8
9
10
11
# File 'lib/leeno/api/canvas.rb', line 8

def find! id, options={}
  raise(Leeno::DocumentNotFound.new("#{model_class}: id NilClass")) if id.nil?
  search_show({canvas_id: id.to_s}.merge(options), true)
end