Class: SBConstants::Location
- Inherits:
-
Struct
- Object
- Struct
- SBConstants::Location
- Defined in:
- lib/sbconstants/location.rb
Instance Attribute Summary collapse
-
#attribute ⇒ Object
Returns the value of attribute attribute.
-
#context ⇒ Object
Returns the value of attribute context.
-
#file ⇒ Object
Returns the value of attribute file.
-
#line ⇒ Object
Returns the value of attribute line.
-
#node ⇒ Object
Returns the value of attribute node.
Instance Method Summary collapse
Instance Attribute Details
#attribute ⇒ Object
Returns the value of attribute attribute
2 3 4 |
# File 'lib/sbconstants/location.rb', line 2 def attribute @attribute end |
#context ⇒ Object
Returns the value of attribute context
2 3 4 |
# File 'lib/sbconstants/location.rb', line 2 def context @context end |
#file ⇒ Object
Returns the value of attribute file
2 3 4 |
# File 'lib/sbconstants/location.rb', line 2 def file @file end |
#line ⇒ Object
Returns the value of attribute line
2 3 4 |
# File 'lib/sbconstants/location.rb', line 2 def line @line end |
#node ⇒ Object
Returns the value of attribute node
2 3 4 |
# File 'lib/sbconstants/location.rb', line 2 def node @node end |
Instance Method Details
#debug ⇒ Object
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 |
#hash ⇒ Object
15 16 17 |
# File 'lib/sbconstants/location.rb', line 15 def hash key_path.hash end |
#key_path ⇒ Object
3 4 5 |
# File 'lib/sbconstants/location.rb', line 3 def key_path @key_path ||= [node, attribute].compact.join('.') end |