class Clausewitz::Spelling::InvalidFilepathResult

Result capturing basic problems interacting with the file before parsing.

Attributes

error[R]
filepath[R]

Public Class Methods

new(filepath, error) click to toggle source
# File lib/clausewitz/spelling/results.rb, line 264
def initialize(filepath, error)
  @filepath = filepath
  @error    = error
end

Public Instance Methods

failed?() click to toggle source
# File lib/clausewitz/spelling/results.rb, line 269
def failed?
  true
end
failure_total() click to toggle source
# File lib/clausewitz/spelling/results.rb, line 273
def failure_total
  1
end
to_s() click to toggle source
# File lib/clausewitz/spelling/results.rb, line 277
def to_s
  to_str
end
to_str(indent = 0) click to toggle source
# File lib/clausewitz/spelling/results.rb, line 281
def to_str(indent = 0)
  spacer = ' ' * indent
  secondspacer = ' ' * (indent + 2)
  "#{spacer}#{@filepath} is invalid\n".red +
    "#{secondspacer}#{@error.message}".red
end