Class: CtagsReader::Tag

Inherits:
Struct
  • Object
show all
Defined in:
lib/ctags_reader/tag.rb

Overview

The Tag is the representation of each tag in the tags file. It can be initialized manually by giving it its four components, but it can also be created from a tab-delimited line from the file.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ex_commandObject

Returns the value of attribute ex_command

Returns:

  • (Object)

    the current value of ex_command



6
7
8
# File 'lib/ctags_reader/tag.rb', line 6

def ex_command
  @ex_command
end

#filenameObject

Returns the value of attribute filename

Returns:

  • (Object)

    the current value of filename



6
7
8
# File 'lib/ctags_reader/tag.rb', line 6

def filename
  @filename
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



6
7
8
# File 'lib/ctags_reader/tag.rb', line 6

def name
  @name
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



6
7
8
# File 'lib/ctags_reader/tag.rb', line 6

def type
  @type
end

Class Method Details

.from_string(string) ⇒ Object



7
8
9
10
# File 'lib/ctags_reader/tag.rb', line 7

def self.from_string(string)
  name, filename, ex_command, type = string.split("\t")
  new(name, filename, ex_command, type)
end

Instance Method Details

#line_numberObject



12
13
14
# File 'lib/ctags_reader/tag.rb', line 12

def line_number
  @line_number ||= calculate_line_number
end