Class: Episodic::Platform::WriteResponse

Inherits:
Response
  • Object
show all
Defined in:
lib/episodic/platform/write_methods.rb

Overview

All write methods have a similar response structure. This class extends Episodic::Platform::Response and adds a method to get the id of the created/updated object (‘playlist_id’, ‘episode_id’, etc).

Direct Known Subclasses

CreateUpdateEpisodeResponse

Instance Method Summary collapse

Methods inherited from Response

#xml

Constructor Details

#initialize(response, xml_options = {"ForceArray" => false}) ⇒ WriteResponse

Constructor

Parameters

response<Episodic::Platform::HTTPResponse>

The response object returned from an Episodic Platform API request.

xml_options<Hash>

A set of options used by XmlSimple when parsing the response body



344
345
346
# File 'lib/episodic/platform/write_methods.rb', line 344

def initialize response, xml_options = {"ForceArray" => false}
  super(response, xml_options)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_sym, *arguments, &block) ⇒ Object

Override to just check for the value in the attributes



351
352
353
# File 'lib/episodic/platform/write_methods.rb', line 351

def method_missing(method_sym, *arguments, &block)
  return @parsed_body[method_sym.to_s]
end

Instance Method Details

#respond_to?(symbol, include_private = false) ⇒ Boolean

Always return true.

Returns:

  • (Boolean)


358
359
360
# File 'lib/episodic/platform/write_methods.rb', line 358

def respond_to?(symbol, include_private = false)
  return true
end