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

- (Format) initialize(format_code, name)

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

- (Object) format_code (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

- (Object) name (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

+ (Object) by_code(format_code)



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

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