Class: SBConstants::Location

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#attributeObject

Returns the value of attribute attribute



2
3
4
# File 'lib/sbconstants/location.rb', line 2

def attribute
  @attribute
end

#contextObject

Returns the value of attribute context



2
3
4
# File 'lib/sbconstants/location.rb', line 2

def context
  @context
end

#fileObject

Returns the value of attribute file



2
3
4
# File 'lib/sbconstants/location.rb', line 2

def file
  @file
end

#lineObject

Returns the value of attribute line



2
3
4
# File 'lib/sbconstants/location.rb', line 2

def line
  @line
end

#nodeObject

Returns the value of attribute node



2
3
4
# File 'lib/sbconstants/location.rb', line 2

def node
  @node
end

Instance Method Details

#debugObject



7
8
9
# File 'lib/sbconstants/location.rb', line 7

def debug
  @debug ||= "#{file}[line:#{line}](#{key_path})"
end

#eql?(other) ⇒ Boolean



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

def eql? other
  self.class == other.class && key_path == other.key_path
end

#hashObject



15
16
17
# File 'lib/sbconstants/location.rb', line 15

def hash
  key_path.hash
end

#key_pathObject



3
4
5
# File 'lib/sbconstants/location.rb', line 3

def key_path
  @key_path ||= [node, attribute].compact.join('.')
end