Module: Parser::MetaContainer

Included in:
CodeObject::Base, Comment
Defined in:
lib/parser/meta_container.rb

Overview

is included by CodeObject::Base and Comment

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#filepathObject (readonly)

Returns the value of attribute filepath.



6
7
8
# File 'lib/parser/meta_container.rb', line 6

def filepath
  @filepath
end

#line_startObject (readonly)

Returns the value of attribute line_start.



6
7
8
# File 'lib/parser/meta_container.rb', line 6

def line_start
  @line_start
end

#sourceObject (readonly)

Returns the value of attribute source.



6
7
8
# File 'lib/parser/meta_container.rb', line 6

def source
  @source
end

Instance Method Details

#add_meta_data(filepath, source, line_start) ⇒ Object



8
9
10
# File 'lib/parser/meta_container.rb', line 8

def (filepath, source, line_start)
  @filepath, @source, @line_start = filepath, source, line_start+1 # counting from 1
end

#clone_meta(other) ⇒ Object



12
13
14
# File 'lib/parser/meta_container.rb', line 12

def clone_meta(other)
  @filepath, @source, @line_start = other.filepath, other.source, other.line_start
end