Class: Twitter::MediaFactory

Inherits:
Factory
  • Object
show all
Defined in:
lib/twitter/media_factory.rb

Overview

Factory for creating media objects based on type

Class Method Summary collapse

Class Method Details

.new(attrs = {}) ⇒ Twitter::Media

Constructs a new media object

Examples:

Twitter::MediaFactory.new(type: "photo", id: 123)

Parameters:

  • attrs (Hash) (defaults to: {})

    The attributes hash with a :type key

Returns:

Raises:

  • (IndexError)

    Error raised when argument is missing a :type key



18
19
20
# File 'lib/twitter/media_factory.rb', line 18

def new(attrs = {})
  super(:type, Media, attrs)
end