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

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

Constant Summary

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(format_code, name) ⇒ Format

Returns a new instance of Format



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

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

  @@formats[format_code] = self
end

Instance Attribute Details

#format_codeObject (readonly)

Returns the value of attribute format_code



12
13
14
# File 'lib/youtube_it/model/video.rb', line 12

def format_code
  @format_code
end

#nameObject (readonly)

Returns the value of attribute name



12
13
14
# File 'lib/youtube_it/model/video.rb', line 12

def name
  @name
end

Class Method Details

.by_code(format_code) ⇒ Object



42
43
44
# File 'lib/youtube_it/model/video.rb', line 42

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