class PPZ::Folder::AbstractFileModel

Attributes

file_ext[R]

Public Class Methods

from_path(path, level) click to toggle source
# File lib/folder/model/file/abstract.rb, line 3
def self.from_path path, level
  if (File.extname path) == '.ppz'
    PPZFileModel.new path, level
  else
    OtherFileModel.new path, level
  end
end
new(path, level) click to toggle source
Calls superclass method PPZ::Folder::AbstractModel::new
# File lib/folder/model/file/abstract.rb, line 12
def initialize path, level
  super
  temp_bn = @basename
  if /^(\d+)_/.match temp_bn
    @index = $1.to_i
    temp_bn = temp_bn[($1.size + 1)..-1]
  else
    @index = Float::INFINITY
  end

  /(.*)(\.[^\.]+)$/.match temp_bn
  @name = $1 || temp_bn
  @file_ext = $2 || ''
end