Class: Mutant::AST::Pattern::Source Private

Inherits:
Object
  • Object
show all
Defined in:
lib/mutant/ast/pattern/source.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Defined Under Namespace

Classes: Location

Instance Method Summary collapse

Constructor Details

#initialize(**attributes) ⇒ Source

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Source.



9
10
11
12
13
# File 'lib/mutant/ast/pattern/source.rb', line 9

def initialize(**attributes)
  super

  @lines = string.split("\n")
end

Instance Method Details

#line(line_index) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



15
16
17
# File 'lib/mutant/ast/pattern/source.rb', line 15

def line(line_index)
  @lines.fetch(line_index)
end