class SparkleFormation::AuditLog::SourcePoint

Attributes

line[R]
path[R]

Public Class Methods

new(*args) click to toggle source
# File lib/sparkle_formation/audit_log.rb, line 9
def initialize(*args)
  if args.last.is_a?(Hash)
    opts = args.pop.to_smash
  else
    opts = Smash.new
  end
  @path, @line = args
  @path = opts[:path] if opts[:path]
  @line = opts[:line] if opts[:line]
  @line = @line.to_i
  unless @path
    raise ArgumentError,
      "Missing expected value for `path`"
  end
  if !@path.is_a?(String) && !@path.is_a?(Symbol)
    raise TypeError,
      "Expected `String` or `Symbol` for path but received `#{@path.class}`"
  end
end