lib/vs_scorm/manifest.rb
# Versions of the SCORM standard that are supported
Versions of the SCORM standard that are supported
Versions of the SCORM standard that are supported
def resources(options = nil)
      if (options.nil?) || (!options.is_a?(Hash))
        @resources.values
      else
        subset = @resources.values
        if options[:id]
          subset = subset.find_all {|r| r.id == options[:id].to_s }
        end
        if options[:type]
          subset = subset.find_all {|r| r.type == options[:type].to_s }
        end
        if options[:scorm_type]
          subset = subset.find_all {|r| r.scorm_type == options[:scorm_type].to_s }
        end
        if options[:href]
          subset = subset.find_all {|r| r.href == options[:href].to_s }
        end
        if options[:with_file]
          subset = subset.find_all {|r| r.files.include?(options[:with_file].to_s) }
        end
        subset
      end
    end
def resources ( options = nil ) if ( options . nil? ) || ( ! options . is_a? ( Hash ) ) @resources . values else subset = @resources . values if options [ :id ] subset = subset . find_all { | r | r . id == options [ :id ] . to_s } end if options [ :type ] subset = subset . find_all { | r | r . type == options [ :type ] . to_s } end if options [ :scorm_type ] subset = subset . find_all { | r | r . scorm_type == options [ :scorm_type ] . to_s } end if options [ :href ] subset = subset . find_all { | r | r . href == options [ :href ] . to_s } end if options [ :with_file ] subset = subset . find_all { | r | r . files . include? ( options [ :with_file ] . to_s ) } end subset end end
Versions of the SCORM standard that are supported
Versions of the SCORM standard that are supported
options
<not_specific>