Sha256: 617817da3115710ebc93893f2eb868ec179da693647abac804723837cc0da7aa
Contents?: true
Size: 1017 Bytes
Versions: 54
Compression:
Stored size: 1017 Bytes
Contents
class Ey::Core::Client class Real def create_addon(params={}) url = params.delete("url") or raise "URL needed" request( :method => :post, :url => url, :params => params, ) end end # Real class Mock def create_addon(params={}) url = params.delete("url") or raise "URL needed" account_id = path_params(url)["accounts"] or raise "Need account id, not parsed from #{url}" resource_id = self.serial_id resource = params["addon"].merge( "id" => resource_id, "addon_attachments" => url_for("/accounts/#{account_id}/addons/#{resource_id}/attachments"), "account" => url_for("/accounts/#{account_id}"), "vars" => normalize_hash(params["addon"]["vars"] || {}), ) self.data[:addons][resource_id] = resource response( :body => {"addon" => resource}, :status => 201, ) end end # Mock end # Ey::Core::Client
Version data entries
54 entries across 54 versions & 3 rubygems