class MultimediaParadise::Video::RegisteredVideoFile

Constants

NAMESPACE
#

NAMESPACE

#

Public Class Methods

[](i = '') click to toggle source
#

MultimediaParadise::Video::RegisteredVideoFile[]

#
# File lib/multimedia_paradise/video/registered_video_file.rb, line 123
def self.[](i = '')
  self.new
end
new( i = nil, run_already = true ) click to toggle source
#

initialize

#
# File lib/multimedia_paradise/video/registered_video_file.rb, line 31
def initialize(
    i           = nil,
    run_already = true
  )
  reset
  set_original_input(i)
  run if run_already
end

Public Instance Methods

check_for_the_position_first() click to toggle source
#

check_for_the_position_first

#
# File lib/multimedia_paradise/video/registered_video_file.rb, line 88
def check_for_the_position_first
  this_position = input_without_extension?.to_i # Get the input position first.
  msg_to_the_user = 'Checking for position '+simp(this_position.to_s)+' first.'
  _ = return_video_collection_dataset
  this_result = _[this_position]
  if this_result
    title = this_result['title']
    msg_to_the_user << ' The file name should be '+sfancy(title)+'.'
  else
    msg_to_the_user << ' That position appears to be vacant.'+N
    msg_to_the_user << 'It could still exist on another position, '
                       'but it may also be obsolete.'
  end
  e msg_to_the_user
end
input_without_extension?() click to toggle source
#

input_without_extension?

#
# File lib/multimedia_paradise/video/registered_video_file.rb, line 76
def input_without_extension?
  extname = File.extname(original_input?)
  _ = original_input?.gsub(/#{extname}$/,'')
  if _.include? '_'
    _ = _.split('_').first
  end
  return _
end
original_input?() click to toggle source
#

original_input?

#
# File lib/multimedia_paradise/video/registered_video_file.rb, line 69
def original_input?
  @original_input
end
reset() click to toggle source
#

reset (reset tag)

#
Calls superclass method MultimediaParadise::Base#reset
# File lib/multimedia_paradise/video/registered_video_file.rb, line 43
def reset
  super()
  # ======================================================================= #
  # === @namespace
  # ======================================================================= #
  @namespace = NAMESPACE
end
return_video_collection_dataset() click to toggle source
#

return_video_collection_dataset

#
# File lib/multimedia_paradise/video/registered_video_file.rb, line 107
def return_video_collection_dataset
  YAML.load_file(
    MultimediaParadise.file_video_collection
  )
end
run() click to toggle source
#

run (run tag)

#
# File lib/multimedia_paradise/video/registered_video_file.rb, line 116
def run
  check_for_the_position_first
end
set_original_input(i = nil) click to toggle source
#

set_original_input

This must not be modified at ALL.

#
# File lib/multimedia_paradise/video/registered_video_file.rb, line 56
def set_original_input(i = nil)
  i = i.first if i.is_a? Array
  if i.nil?
    opnn; e 'Please provide a file name to this class.'
    exit
  end
  i = i.to_s.dup
  @original_input = i
end