Class: Findyml::Key

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#alias_pathObject

Returns the value of attribute alias_path

Returns:

  • (Object)

    the current value of alias_path



11
12
13
# File 'lib/findyml.rb', line 11

def alias_path
  @alias_path
end

#fileObject

Returns the value of attribute file

Returns:

  • (Object)

    the current value of file



11
12
13
# File 'lib/findyml.rb', line 11

def file
  @file
end

#nodeObject

Returns the value of attribute node

Returns:

  • (Object)

    the current value of node



11
12
13
# File 'lib/findyml.rb', line 11

def node
  @node
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



11
12
13
# File 'lib/findyml.rb', line 11

def path
  @path
end

#terminalObject

Returns the value of attribute terminal

Returns:

  • (Object)

    the current value of terminal



11
12
13
# File 'lib/findyml.rb', line 11

def terminal
  @terminal
end

Instance Method Details

#colObject



18
19
20
# File 'lib/findyml.rb', line 18

def col
  node.start_column + 1
end

#inspectObject



22
23
24
# File 'lib/findyml.rb', line 22

def inspect
  "#{path.map(&:inspect).join('.')} -> #{self}"
end

#lineObject



14
15
16
# File 'lib/findyml.rb', line 14

def line
  node.start_line + 1
end

#locationObject



26
27
28
# File 'lib/findyml.rb', line 26

def location
  [file, line, col].join(':')
end

#terminal?Boolean

Returns:

  • (Boolean)


12
# File 'lib/findyml.rb', line 12

def terminal? = terminal