Class: GoogleVideo::Record

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

Overview

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

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Record

Returns a new instance of Record.



48
49
50
51
52
53
54
55
# File 'lib/google-video.rb', line 48

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