Sha256: 4aad3df9fa166f5ceef47f71a466ce5500ac1c62c2337702e0945c936a0607a0

Contents?: true

Size: 578 Bytes

Versions: 31

Compression:

Stored size: 578 Bytes

Contents

# frozen_string_literal: true

module Synvert::Core
  # Warning is used to save warning message.
  class Rewriter::Warning
    # Initialize a Warning.
    #
    # @param instance [Synvert::Core::Rewriter::Instance]
    # @param message [String] warning message.
    def initialize(instance, message)
      @file_path = instance.current_file
      @line = instance.current_node.loc.expression.line
      @message = message
    end

    # Warning message.
    #
    # @return [String] warning message.
    def message
      "#{@file_path}##{@line}: #{@message}"
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
synvert-core-1.15.0 lib/synvert/core/rewriter/warning.rb
synvert-core-1.14.2 lib/synvert/core/rewriter/warning.rb
synvert-core-1.14.1 lib/synvert/core/rewriter/warning.rb
synvert-core-1.14.0 lib/synvert/core/rewriter/warning.rb
synvert-core-1.13.1 lib/synvert/core/rewriter/warning.rb
synvert-core-1.13.0 lib/synvert/core/rewriter/warning.rb
synvert-core-1.12.0 lib/synvert/core/rewriter/warning.rb
synvert-core-1.11.0 lib/synvert/core/rewriter/warning.rb
synvert-core-1.10.1 lib/synvert/core/rewriter/warning.rb
synvert-core-1.10.0 lib/synvert/core/rewriter/warning.rb
synvert-core-1.9.2 lib/synvert/core/rewriter/warning.rb
synvert-core-1.9.1 lib/synvert/core/rewriter/warning.rb
synvert-core-1.9.0 lib/synvert/core/rewriter/warning.rb
synvert-core-1.8.1 lib/synvert/core/rewriter/warning.rb
synvert-core-1.8.0 lib/synvert/core/rewriter/warning.rb
synvert-core-1.7.0 lib/synvert/core/rewriter/warning.rb
synvert-core-1.6.0 lib/synvert/core/rewriter/warning.rb
synvert-core-1.5.0 lib/synvert/core/rewriter/warning.rb
synvert-core-1.4.0 lib/synvert/core/rewriter/warning.rb
synvert-core-1.3.1 lib/synvert/core/rewriter/warning.rb