Method: Camdram::Client#get_org
- Defined in:
- lib/camdram/client.rb
#get_org(id) ⇒ Camdram::Organisation
Lookup an organisation by its ID or slug
109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/camdram/client.rb', line 109 def get_org(id) url = nil if id.is_a? Integer url = "#{Organisation.url}/by-id/#{id}.json" elsif id.is_a? String url = "#{Organisation.url}/#{id}.json" else raise ArgumentError.new 'id must be an integer, or slug must be a string' end response = get(url) Organisation.new(response) end |