Class: Twitter::MediaFactory
- Inherits:
-
Object
- Object
- Twitter::MediaFactory
- Defined in:
- lib/twitter/media_factory.rb
Class Method Summary collapse
-
.new(media = {}) ⇒ Twitter::Photo
Instantiates a new media object.
Class Method Details
.new(media = {}) ⇒ Twitter::Photo
Instantiates a new media object
11 12 13 14 15 16 17 18 |
# File 'lib/twitter/media_factory.rb', line 11 def self.new(media={}) type = media.delete('type') if type Twitter.const_get(type.capitalize.to_sym).new(media) else raise ArgumentError, "argument must have a 'type' key" end end |