module WahWah
Constants
- FORMATE_MAPPING
- VERSION
Public Class Methods
open(file_path)
click to toggle source
# File lib/wahwah.rb, line 62 def self.open(file_path) file_path = file_path.to_path if file_path.respond_to? :to_path file_path = file_path.to_str file_format = Helper.file_format(file_path) raise WahWahArgumentError, 'File is not exists' unless File.exist? file_path raise WahWahArgumentError, 'File is unreadable' unless File.readable? file_path raise WahWahArgumentError, 'File is empty' unless File.size(file_path) > 0 raise WahWahArgumentError, 'No supported format found' unless support_formats.include? file_format FORMATE_MAPPING.each do |tag, formats| break const_get(tag).new(file_path) if formats.include?(file_format) end end
support_formats()
click to toggle source
# File lib/wahwah.rb, line 78 def self.support_formats FORMATE_MAPPING.values.flatten end