Class: RubyLint::MethodCallInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-lint/method_call_info.rb

Overview

The MethodCallInfo class stores basic information about method calls such as the definition of the method and location information of the method call.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ MethodCallInfo

Returns a new instance of MethodCallInfo

Parameters:

  • options (Hash) (defaults to: {})


25
26
27
28
29
# File 'lib/ruby-lint/method_call_info.rb', line 25

def initialize(options = {})
  options.each do |key, value|
    instance_variable_set("@#{key}", value) if respond_to?(key)
  end
end

Instance Attribute Details

#columnNumeric (readonly)

Returns The column of the method call.

Returns:

  • (Numeric)

    The column of the method call.



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/ruby-lint/method_call_info.rb', line 19

class MethodCallInfo
  attr_reader :definition, :line, :column, :file

  ##
  # @param [Hash] options
  #
  def initialize(options = {})
    options.each do |key, value|
      instance_variable_set("@#{key}", value) if respond_to?(key)
    end
  end
end

#definitionRubyLint::Definition::RubyMethod (readonly)



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/ruby-lint/method_call_info.rb', line 19

class MethodCallInfo
  attr_reader :definition, :line, :column, :file

  ##
  # @param [Hash] options
  #
  def initialize(options = {})
    options.each do |key, value|
      instance_variable_set("@#{key}", value) if respond_to?(key)
    end
  end
end

#fileString (readonly)

Returns The file of the method call.

Returns:

  • (String)

    The file of the method call.



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/ruby-lint/method_call_info.rb', line 19

class MethodCallInfo
  attr_reader :definition, :line, :column, :file

  ##
  # @param [Hash] options
  #
  def initialize(options = {})
    options.each do |key, value|
      instance_variable_set("@#{key}", value) if respond_to?(key)
    end
  end
end

#lineNumeric (readonly)

Returns The line of the method call.

Returns:

  • (Numeric)

    The line of the method call.



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/ruby-lint/method_call_info.rb', line 19

class MethodCallInfo
  attr_reader :definition, :line, :column, :file

  ##
  # @param [Hash] options
  #
  def initialize(options = {})
    options.each do |key, value|
      instance_variable_set("@#{key}", value) if respond_to?(key)
    end
  end
end