Class: GoogleVideo::VideoDetailsRequest

Inherits:
Record
  • Object
show all
Defined in:
lib/google-video.rb

Overview

Describes a request of the Google Video service for details on a specific previously retrieved Video or its stored doc_id. Only one of either video or doc_id should be specified in the request. Parameters are specified via a hash passed to the object on construction mapping attribute names to their respective values.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ VideoDetailsRequest

Constructs a VideoDetailsRequest with the supplied hash mapping attribute names to their respective values.



410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
# File 'lib/google-video.rb', line 410

def initialize (params)
  super(params)
  
  # validate request parameters
  if !@video && !@doc_id
    raise ArgumentError.new("invalid request, one of video or doc_id parameter required")
  end
  if @video && @doc_id
    raise ArgumentError.new("invalid request, only one of video or doc_id parameters may be specified")
  end
  if @video && !@video.is_a?(Video)
    raise ArgumentError.new("invalid request, video must be a GoogleVideo::Video")
  end
  if @doc_id && !@doc_id.is_a?(Bignum)
    raise ArgumentError.new("invalid request, doc_id must be a Bignum")
  end
end

Instance Attribute Details

#doc_idObject (readonly)

the doc_id of the video whose details are sought.



406
407
408
# File 'lib/google-video.rb', line 406

def doc_id
  @doc_id
end

#videoObject (readonly)

the Video object whose details are sought.



403
404
405
# File 'lib/google-video.rb', line 403

def video
  @video
end