Class: YahooVideo::Record
- Inherits:
-
Object
- Object
- YahooVideo::Record
- 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
Instance Method Summary collapse
-
#initialize(params) ⇒ Record
constructor
A new instance of Record.
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 |