Sha256: 49f56f7f638472f554402c4ae7e20d59e383031b81ec5da60441433248fc138a
Contents?: true
Size: 1.06 KB
Versions: 15
Compression:
Stored size: 1.06 KB
Contents
class Ey::Core::Client class Real def get_addon_attachments(params={}) if account_id = params["account_id"] params["url"] = "/accounts/#{account_id}/attachments" end url = params.delete("url") or raise "URL needed" request( :params => params, :path => url, :url => url, ) end end # Real class Mock def get_addon_attachments(params={}) if account_id = params.delete("account_id") params["url"] = "/accounts/#{account_id}/attachments" end extract_url_params!(params) account = find(:accounts, params["account"]) addon = find(:addons, params["addon"]) rescue nil found_attachments = load_addon_attachments(account["id"], addon && addon["name"]) if addon found_attachments.select! {|a| a["key"] } end response( :body => {"addon_attachments" => found_attachments}, :status => 201, :headers => { "Content-Type" => "application/json; charset=utf8" } ) end end # Mock end
Version data entries
15 entries across 15 versions & 1 rubygems