Class: Twitter::Media::Video

Inherits:
Identity show all
Includes:
Memoizable
Defined in:
lib/twitter/media/video.rb

Direct Known Subclasses

AnimatedGif

Instance Attribute Summary collapse

Attributes inherited from Identity

#id

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Methods inherited from Identity

#initialize

Methods inherited from Base

#[], attr_reader, define_attribute_method, define_predicate_method, define_uri_method, display_uri_attr_reader, #initialize, object_attr_reader, predicate_attr_reader, uri_attr_reader

Methods included from Utils

flat_pmap, pmap

Constructor Details

This class inherits a constructor from Twitter::Identity

Instance Attribute Details

#indicesArray<Integer> (readonly)

Returns:

  • (Array<Integer>)


11
12
13
# File 'lib/twitter/media/video.rb', line 11

def indices
  @indices
end

#typeString (readonly)

Returns:

  • (String)


14
15
16
# File 'lib/twitter/media/video.rb', line 14

def type
  @type
end

Instance Method Details

#sizesArray<Twitter::Size>

Returns an array of photo sizes

Returns:



22
23
24
25
26
# File 'lib/twitter/media/video.rb', line 22

def sizes
  @attrs.fetch(:sizes, []).each_with_object({}) do |(key, value), object|
    object[key] = Size.new(value)
  end
end

#video_infoTwitter::Media::VideoInfo

Returns video info



32
33
34
# File 'lib/twitter/media/video.rb', line 32

def video_info
  VideoInfo.new(@attrs[:video_info]) unless @attrs[:video_info].nil?
end