Class: RakeMKV::Code

Inherits:
Object
  • Object
show all
Defined in:
lib/rakemkv/code.rb

Overview

Code

Constant Summary collapse

CODES =
[
  :unknown,
  :type,
  :name,
  :language_code,
  :language_name,
  :codec_id,
  :codec_short,
  :codec_long,
  :chapter_count,
  :duration,
  :disk_size,
  :disk_size_bytes,
  :stream_type_extension,
  :bitrate,
  :audio_channels_count,
  :angle_info,
  :source_file_name,
  :audio_sample_rate,
  :audio_sample_size,
  :video_size,
  :video_aspect_ratio,
  :video_frame_rate,
  :stream_flags,
  :date_time,
  :original_title_id,
  :segments_count,
  :segments_map,
  :output_file_name,
  :metadata_language_code,
  :metadata_language_name,
  :tree_info,
  :panel_title,
  :volume_name,
  :order_weight,
  :output_format,
  :output_format_description,
  :seamless_info,
  :panel_text,
  :mkv_flags,
  :mkv_flags_text,
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(index) ⇒ Code

Initialize code



49
50
51
# File 'lib/rakemkv/code.rb', line 49

def initialize(index)
  @index = index.to_i
end

Instance Attribute Details

#indexObject (readonly)

Returns the value of attribute index.



46
47
48
# File 'lib/rakemkv/code.rb', line 46

def index
  @index
end

Class Method Details

.[](index) ⇒ Object

Short hand to initialize code and convert it to symbol



59
60
61
# File 'lib/rakemkv/code.rb', line 59

def self.[](index)
  new(index).to_sym
end

Instance Method Details

#to_symObject

Take code and convert it to the proper symbol



54
55
56
# File 'lib/rakemkv/code.rb', line 54

def to_sym
  CODES[index]
end