class Texico::Template::FileStatus

FileStatus

The FileStatus object represents the result of a copy command on a template file. This class should never be used directly.

Constants

STATUS

Attributes

file[R]

Public Class Methods

new(file, status = STATUS[0]) click to toggle source
# File lib/texico/template/file_status.rb, line 12
def initialize(file, status = STATUS[0])
  unless STATUS.include?(status) || status.is_a?(Exception)
    raise ArgumentError, 'Unknown status'
  end

  @status    = status
  @file      = file

  freeze
end

Public Instance Methods

status() click to toggle source
# File lib/texico/template/file_status.rb, line 27
def status
  @status.is_a?(Exception) ? :template_error : @status
end
to_s() click to toggle source
# File lib/texico/template/file_status.rb, line 23
def to_s
  "#{file.basename} [#{status}]"
end