Class: RubyLint::GeneratedConstant

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

Overview

GeneratedConstant contains information about a constant (and its data) that was pre-generated using DefinitionGenerator.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ GeneratedConstant

Returns a new instance of GeneratedConstant

Parameters:

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


27
28
29
30
31
32
33
34
35
# File 'lib/ruby-lint/generated_constant.rb', line 27

def initialize(attributes = {})
  attributes.each do |key, value|
    instance_variable_set("@#{key}", value)
  end

  @modules    ||= []
  @methods    ||= []
  @superclass ||= 'Object'
end

Instance Attribute Details

#constantClass (readonly)

Returns:

  • (Class)


21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/ruby-lint/generated_constant.rb', line 21

class GeneratedConstant
  attr_reader :methods, :name, :constant, :superclass, :modules

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

    @modules    ||= []
    @methods    ||= []
    @superclass ||= 'Object'
  end
end

#methodsHash (readonly)

Returns:

  • (Hash)


21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/ruby-lint/generated_constant.rb', line 21

class GeneratedConstant
  attr_reader :methods, :name, :constant, :superclass, :modules

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

    @modules    ||= []
    @methods    ||= []
    @superclass ||= 'Object'
  end
end

#modulesArray (readonly)

Returns:

  • (Array)


21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/ruby-lint/generated_constant.rb', line 21

class GeneratedConstant
  attr_reader :methods, :name, :constant, :superclass, :modules

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

    @modules    ||= []
    @methods    ||= []
    @superclass ||= 'Object'
  end
end

#nameString (readonly)

Returns:



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/ruby-lint/generated_constant.rb', line 21

class GeneratedConstant
  attr_reader :methods, :name, :constant, :superclass, :modules

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

    @modules    ||= []
    @methods    ||= []
    @superclass ||= 'Object'
  end
end

#superclassString (readonly)

Returns:



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/ruby-lint/generated_constant.rb', line 21

class GeneratedConstant
  attr_reader :methods, :name, :constant, :superclass, :modules

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

    @modules    ||= []
    @methods    ||= []
    @superclass ||= 'Object'
  end
end