Class: YahooVideo::Record

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

Overview

A generic record that initializes instance variables from the supplied hash mapping symbol names to their respective values.

Direct Known Subclasses

SearchRequest, SearchResponse, SearchResult, Thumbnail

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Record

Returns a new instance of Record.



34
35
36
37
38
39
40
41
# File 'lib/yahoo-video.rb', line 34

def initialize (params)
  if params
    params.each do |key, value| 
      name = key.to_s
      instance_variable_set("@#{name}", value) if respond_to?(name)
    end
  end
end