Module: Parser::MetaContainer

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

Overview

Is included by CodeObject::Base and Comment and stores Metainformation like

  • filepath of the JavaScript-File, where the comment is extracted from

  • source of the JavaScript-Scope, which begins just after the comment ends.

  • line_start - Linenumber of the first scope-line

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#filepathObject (readonly)

Returns the value of attribute filepath.



10
11
12
# File 'lib/parser/meta_container.rb', line 10

def filepath
  @filepath
end

#line_startObject (readonly)

Returns the value of attribute line_start.



10
11
12
# File 'lib/parser/meta_container.rb', line 10

def line_start
  @line_start
end

#sourceObject (readonly)

Returns the value of attribute source.



10
11
12
# File 'lib/parser/meta_container.rb', line 10

def source
  @source
end

Instance Method Details

#add_meta_data(filepath, source, line_start) ⇒ Object



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

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

#clone_meta(other) ⇒ Object



16
17
18
# File 'lib/parser/meta_container.rb', line 16

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