Module: Animoto::Support::StandardEnvelope::ClassMethods

Defined in:
lib/animoto/support/standard_envelope.rb

Instance Method Summary collapse

Instance Method Details

#payload_key(key = nil) ⇒ String

Get or set the payload key for this class. When building an instance of this class from a response body, the payload key determines which object in the response payload holds the attributes for the instance.

Parameters:

  • key (String, nil) (defaults to: nil)

    the key to set

Returns:

  • (String)

    the payload key (the old key if no argument was given), or the inferred payload key if not set



64
65
66
67
# File 'lib/animoto/support/standard_envelope.rb', line 64

def payload_key key = nil
  @payload_key = key if key
  @payload_key || infer_content_type
end