Class: Necropsy::Node
- Inherits:
-
Data
- Object
- Data
- Necropsy::Node
- Defined in:
- lib/necropsy/models.rb
Instance Attribute Summary collapse
-
#body_digest ⇒ Object
readonly
Returns the value of attribute body_digest.
-
#defined_via ⇒ Object
readonly
Returns the value of attribute defined_via.
-
#definition_id ⇒ Object
readonly
Returns the value of attribute definition_id.
-
#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.
-
#ordinal ⇒ Object
readonly
Returns the value of attribute ordinal.
-
#owner ⇒ Object
readonly
Returns the value of attribute owner.
-
#symbol_id ⇒ Object
readonly
Returns the value of attribute symbol_id.
-
#test ⇒ Object
readonly
Returns the value of attribute test.
-
#visibility ⇒ Object
readonly
Returns the value of attribute visibility.
Class Method Summary collapse
Instance Method Summary collapse
- #fingerprint(classification) ⇒ Object (also: #logical_fingerprint)
- #graph_id ⇒ Object
-
#initialize(id:, kind:, file:, line:, end_line:, defined_via:, owner:, name:, test:, visibility:, symbol_id: id, definition_id: id, body_digest: nil, ordinal: 0) ⇒ Node
constructor
A new instance of Node.
- #method? ⇒ Boolean
- #physical_fingerprint(classification) ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(id:, kind:, file:, line:, end_line:, defined_via:, owner:, name:, test:, visibility:, symbol_id: id, definition_id: id, body_digest: nil, ordinal: 0) ⇒ Node
Returns a new instance of Node.
323 324 325 326 |
# File 'lib/necropsy/models.rb', line 323 def initialize(id:, kind:, file:, line:, end_line:, defined_via:, owner:, name:, test:, visibility:, symbol_id: id, definition_id: id, body_digest: nil, ordinal: 0) super end |
Instance Attribute Details
#body_digest ⇒ Object (readonly)
Returns the value of attribute body_digest
284 285 286 |
# File 'lib/necropsy/models.rb', line 284 def body_digest @body_digest end |
#defined_via ⇒ Object (readonly)
Returns the value of attribute defined_via
284 285 286 |
# File 'lib/necropsy/models.rb', line 284 def defined_via @defined_via end |
#definition_id ⇒ Object (readonly)
Returns the value of attribute definition_id
284 285 286 |
# File 'lib/necropsy/models.rb', line 284 def definition_id @definition_id end |
#end_line ⇒ Object (readonly)
Returns the value of attribute end_line
284 285 286 |
# File 'lib/necropsy/models.rb', line 284 def end_line @end_line end |
#file ⇒ Object (readonly)
Returns the value of attribute file
284 285 286 |
# File 'lib/necropsy/models.rb', line 284 def file @file end |
#id ⇒ Object (readonly)
Returns the value of attribute id
284 285 286 |
# File 'lib/necropsy/models.rb', line 284 def id @id end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind
284 285 286 |
# File 'lib/necropsy/models.rb', line 284 def kind @kind end |
#line ⇒ Object (readonly)
Returns the value of attribute line
284 285 286 |
# File 'lib/necropsy/models.rb', line 284 def line @line end |
#name ⇒ Object (readonly)
Returns the value of attribute name
284 285 286 |
# File 'lib/necropsy/models.rb', line 284 def name @name end |
#ordinal ⇒ Object (readonly)
Returns the value of attribute ordinal
284 285 286 |
# File 'lib/necropsy/models.rb', line 284 def ordinal @ordinal end |
#owner ⇒ Object (readonly)
Returns the value of attribute owner
284 285 286 |
# File 'lib/necropsy/models.rb', line 284 def owner @owner end |
#symbol_id ⇒ Object (readonly)
Returns the value of attribute symbol_id
284 285 286 |
# File 'lib/necropsy/models.rb', line 284 def symbol_id @symbol_id end |
#test ⇒ Object (readonly)
Returns the value of attribute test
284 285 286 |
# File 'lib/necropsy/models.rb', line 284 def test @test end |
#visibility ⇒ Object (readonly)
Returns the value of attribute visibility
284 285 286 |
# File 'lib/necropsy/models.rb', line 284 def visibility @visibility end |
Class Method Details
.data_new ⇒ Object
301 |
# File 'lib/necropsy/models.rb', line 301 alias_method :data_new, :new |
.new(*values, **attributes) ⇒ Object Also known as: []
303 304 305 |
# File 'lib/necropsy/models.rb', line 303 def new(*values, **attributes) compatible_new(*values, **attributes) end |
Instance Method Details
#fingerprint(classification) ⇒ Object Also known as: logical_fingerprint
336 337 338 |
# File 'lib/necropsy/models.rb', line 336 def fingerprint(classification) Digest::SHA256.hexdigest("#{classification}:#{symbol_id}") end |
#graph_id ⇒ Object
332 333 334 |
# File 'lib/necropsy/models.rb', line 332 def graph_id definition_id end |
#method? ⇒ Boolean
328 329 330 |
# File 'lib/necropsy/models.rb', line 328 def method? kind != :block_entry end |
#physical_fingerprint(classification) ⇒ Object
342 343 344 |
# File 'lib/necropsy/models.rb', line 342 def physical_fingerprint(classification) Digest::SHA256.hexdigest("#{classification}:#{definition_id}") end |
#to_h ⇒ Object
346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 |
# File 'lib/necropsy/models.rb', line 346 def to_h { 'id' => id, 'symbol_id' => symbol_id, 'definition_id' => definition_id, 'body_digest' => body_digest, 'ordinal' => ordinal, 'kind' => kind.to_s, 'file' => file, 'line' => line, 'end_line' => end_line, 'defined_via' => defined_via.to_s, 'owner' => owner, 'name' => name, 'test' => test, 'visibility' => visibility.to_s } end |