Class: Necropsy::Node
- Inherits:
-
Data
- Object
- Data
- Necropsy::Node
- Defined in:
- lib/necropsy/models.rb
Instance Attribute Summary collapse
-
#defined_via ⇒ Object
readonly
Returns the value of attribute defined_via.
-
#end_line ⇒ Object
readonly
Returns the value of attribute end_line.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#owner ⇒ Object
readonly
Returns the value of attribute owner.
-
#test ⇒ Object
readonly
Returns the value of attribute test.
Instance Method Summary collapse
Instance Attribute Details
#defined_via ⇒ Object (readonly)
Returns the value of attribute defined_via
6 7 8 |
# File 'lib/necropsy/models.rb', line 6 def defined_via @defined_via end |
#end_line ⇒ Object (readonly)
Returns the value of attribute end_line
6 7 8 |
# File 'lib/necropsy/models.rb', line 6 def end_line @end_line end |
#file ⇒ Object (readonly)
Returns the value of attribute file
6 7 8 |
# File 'lib/necropsy/models.rb', line 6 def file @file end |
#id ⇒ Object (readonly)
Returns the value of attribute id
6 7 8 |
# File 'lib/necropsy/models.rb', line 6 def id @id end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind
6 7 8 |
# File 'lib/necropsy/models.rb', line 6 def kind @kind end |
#line ⇒ Object (readonly)
Returns the value of attribute line
6 7 8 |
# File 'lib/necropsy/models.rb', line 6 def line @line end |
#name ⇒ Object (readonly)
Returns the value of attribute name
6 7 8 |
# File 'lib/necropsy/models.rb', line 6 def name @name end |
#owner ⇒ Object (readonly)
Returns the value of attribute owner
6 7 8 |
# File 'lib/necropsy/models.rb', line 6 def owner @owner end |
#test ⇒ Object (readonly)
Returns the value of attribute test
6 7 8 |
# File 'lib/necropsy/models.rb', line 6 def test @test end |
Instance Method Details
#fingerprint(classification) ⇒ Object
11 12 13 |
# File 'lib/necropsy/models.rb', line 11 def fingerprint(classification) Digest::SHA256.hexdigest("#{classification}:#{id}") end |
#method? ⇒ Boolean
7 8 9 |
# File 'lib/necropsy/models.rb', line 7 def method? kind != :block_entry end |
#to_h ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/necropsy/models.rb', line 15 def to_h { 'id' => id, 'kind' => kind.to_s, 'file' => file, 'line' => line, 'end_line' => end_line, 'defined_via' => defined_via.to_s, 'owner' => owner, 'name' => name, 'test' => test } end |