Sha256: 88f1978f21bc9f67a36d4293dea601a3a051c45b6f7fd88c8b89aec4e0e4d598
Contents?: true
Size: 841 Bytes
Versions: 15
Compression:
Stored size: 841 Bytes
Contents
class Ey::Core::Client class Real def get_addon_attachment(params={}) url = params.delete("url") or raise "URL needed" request( :params => params, :url => url, ) end end # Real class Mock def get_addon_attachment(params={}) extract_url_params!(params) account = find(:accounts, params["account"]) addon = find(:addons, params["addon"]) attachment_id = resource_identity(params["attachment"]) found_attachments = load_addon_attachments(account["id"], addon["name"]) if attachment = found_attachments.find{|attachment| attachment['id'] == attachment_id} response( :body => {"addon_attachment" => attachment}, :status => 200, ) else response(status: 400) end end end # Mock end
Version data entries
15 entries across 15 versions & 1 rubygems