Class: YouTubeIt::Model::Video::Format

Inherits:
Object
  • Object
show all
Defined in:
lib/youtube_it/model/video.rb

Constant Summary collapse

FLASH =
YouTubeIt::Model::Video::Format.new(0, :flash)
RTSP =
YouTubeIt::Model::Video::Format.new(1, :rtsp)
SWF =
YouTubeIt::Model::Video::Format.new(5, :swf)
THREE_GPP =
YouTubeIt::Model::Video::Format.new(6, :three_gpp)
@@formats =
Hash.new

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(format_code, name) ⇒ Format

Returns a new instance of Format.



22
23
24
25
26
27
# File 'lib/youtube_it/model/video.rb', line 22

def initialize(format_code, name)
  @format_code = format_code
  @name = name

  @@formats[format_code] = self
end

Class Method Details

.by_code(format_code) ⇒ Object



40
41
42
# File 'lib/youtube_it/model/video.rb', line 40

def self.by_code(format_code)
  @@formats[format_code]
end