Class: RubyLint::DefinitionBuilder::RubyClass

Inherits:
RubyModule show all
Defined in:
lib/ruby-lint/definition_builder/ruby_class.rb

Overview

Definition builder used for building Ruby classes.

Instance Attribute Summary

Attributes inherited from Base

#node, #options, #vm

Instance Method Summary collapse

Methods inherited from RubyModule

#module_name, #new_definition, #scope

Methods inherited from Base

#constant_name, #initialize

Constructor Details

This class inherits a constructor from RubyLint::DefinitionBuilder::Base

Instance Method Details

#after_initializeObject

Called after creating a new instance of the class.



10
11
12
# File 'lib/ruby-lint/definition_builder/ruby_class.rb', line 10

def after_initialize
  options[:parent] ||= vm.global_constant('Object')
end

#buildObject

Builds the definition for a Ruby class.



19
20
21
# File 'lib/ruby-lint/definition_builder/ruby_class.rb', line 19

def build
  return new_definition([options[:parent], vm.current_scope])
end