Class: ActiveMutator::Subject
- Inherits:
-
Data
- Object
- Data
- ActiveMutator::Subject
- Defined in:
- lib/active_mutator/subject.rb
Overview
A mutable unit: one method definition.
byte_range/line_range cover the whole def ... end.
sclass: def lives inside class << self — its source slice is def foo,
so Inserter must target the singleton class, not the constant itself.
Instance Attribute Summary collapse
-
#byte_range ⇒ Object
readonly
Returns the value of attribute byte_range.
-
#constant_scope ⇒ Object
readonly
Returns the value of attribute constant_scope.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#line_range ⇒ Object
readonly
Returns the value of attribute line_range.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#sclass ⇒ Object
readonly
Returns the value of attribute sclass.
Instance Method Summary collapse
-
#initialize(name:, file:, byte_range:, line_range:, constant_scope:, kind:, sclass: false) ⇒ Subject
constructor
A new instance of Subject.
- #singleton? ⇒ Boolean
Constructor Details
#initialize(name:, file:, byte_range:, line_range:, constant_scope:, kind:, sclass: false) ⇒ Subject
Returns a new instance of Subject.
7 8 9 |
# File 'lib/active_mutator/subject.rb', line 7 def initialize(name:, file:, byte_range:, line_range:, constant_scope:, kind:, sclass: false) super end |
Instance Attribute Details
#byte_range ⇒ Object (readonly)
Returns the value of attribute byte_range
6 7 8 |
# File 'lib/active_mutator/subject.rb', line 6 def byte_range @byte_range end |
#constant_scope ⇒ Object (readonly)
Returns the value of attribute constant_scope
6 7 8 |
# File 'lib/active_mutator/subject.rb', line 6 def constant_scope @constant_scope end |
#file ⇒ Object (readonly)
Returns the value of attribute file
6 7 8 |
# File 'lib/active_mutator/subject.rb', line 6 def file @file end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind
6 7 8 |
# File 'lib/active_mutator/subject.rb', line 6 def kind @kind end |
#line_range ⇒ Object (readonly)
Returns the value of attribute line_range
6 7 8 |
# File 'lib/active_mutator/subject.rb', line 6 def line_range @line_range end |
#name ⇒ Object (readonly)
Returns the value of attribute name
6 7 8 |
# File 'lib/active_mutator/subject.rb', line 6 def name @name end |
#sclass ⇒ Object (readonly)
Returns the value of attribute sclass
6 7 8 |
# File 'lib/active_mutator/subject.rb', line 6 def sclass @sclass end |
Instance Method Details
#singleton? ⇒ Boolean
11 |
# File 'lib/active_mutator/subject.rb', line 11 def singleton? = kind == :singleton |