Class: Tubeclip::Model::Video::Format

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

Constant Summary collapse

FLASH =
Tubeclip::Model::Video::Format.new(0, :flash)
RTSP =
Tubeclip::Model::Video::Format.new(1, :rtsp)
SWF =
Tubeclip::Model::Video::Format.new(5, :swf)
THREE_GPP =
Tubeclip::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/tubeclip/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/tubeclip/model/video.rb', line 12

def format_code
  @format_code
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

Class Method Details

.by_code(format_code) ⇒ Object



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

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