Class: RubyLint::DefinitionBuilder::Base
- Inherits:
-
Object
- Object
- RubyLint::DefinitionBuilder::Base
- Defined in:
- lib/ruby-lint/definition_builder/base.rb
Overview
Base definition builder that provides common methods for individual builder classes.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#node ⇒ RubyLint::AST::Node
readonly
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#vm ⇒ RubyLint::VirtualMachine
readonly
Instance Method Summary collapse
-
#constant_name(node) ⇒ String
protected
Returns the name of a constant node as a String.
-
#initialize(node, vm, options = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(node, vm, options = {}) ⇒ Base
Returns a new instance of Base
21 22 23 24 25 26 27 |
# File 'lib/ruby-lint/definition_builder/base.rb', line 21 def initialize(node, vm, = {}) @node = node @vm = vm @options = after_initialize if respond_to?(:after_initialize) end |
Instance Attribute Details
#node ⇒ RubyLint::AST::Node (readonly)
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/ruby-lint/definition_builder/base.rb', line 13 class Base attr_reader :vm, :node, :options ## # @param [RubyLint::AST::Node] node # @param [RubyLint::VirtualMachine] vm # @param [Hash] options # def initialize(node, vm, = {}) @node = node @vm = vm @options = after_initialize if respond_to?(:after_initialize) end protected ## # Returns the name of a constant node as a String. # # @param [RubyLint::AST::Node] node # @return [String] # def constant_name(node) return node.children[1].to_s end end |
#options ⇒ Object (readonly)
Returns the value of attribute options
14 15 16 |
# File 'lib/ruby-lint/definition_builder/base.rb', line 14 def @options end |
#vm ⇒ RubyLint::VirtualMachine (readonly)
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/ruby-lint/definition_builder/base.rb', line 13 class Base attr_reader :vm, :node, :options ## # @param [RubyLint::AST::Node] node # @param [RubyLint::VirtualMachine] vm # @param [Hash] options # def initialize(node, vm, = {}) @node = node @vm = vm @options = after_initialize if respond_to?(:after_initialize) end protected ## # Returns the name of a constant node as a String. # # @param [RubyLint::AST::Node] node # @return [String] # def constant_name(node) return node.children[1].to_s end end |
Instance Method Details
#constant_name(node) ⇒ String (protected)
Returns the name of a constant node as a String.
37 38 39 |
# File 'lib/ruby-lint/definition_builder/base.rb', line 37 def constant_name(node) return node.children[1].to_s end |