class DFXP

Library to handle DFXP Files

Extends the TTML Class as except for namespace differences there isn't much to call between ttml and dfxp

Constants

SUPPORTED_TRANSFORMATIONS

Public Class Methods

new(cc_file, opts=nil) click to toggle source
# File lib/dfxp.rb, line 15
      def initialize(cc_file, opts=nil)
  @cc_file = cc_file
  @force_detect = opts ? (opts[:force_detect] || false) : false
  raise "Invalid DFXP file provided" unless is_valid?
end

Public Instance Methods

callsign() click to toggle source
# File lib/dfxp.rb, line 31
def callsign
  TYPE_DFXP
end
is_valid?() click to toggle source
# File lib/dfxp.rb, line 21
def is_valid?
  # Do any VTT specific validations here
  if @cc_file =~ /^.*\.(dfxp)$/
    return true
  end
  # TODO: Check if it's required to do a File read to see if this
  # a well-formed XML. Another is to see if lang is available in each div
  return false
end
supported_transformations() click to toggle source
# File lib/dfxp.rb, line 35
def supported_transformations
  return SUPPORTED_TRANSFORMATIONS
end