Module: Ronin::Core::Metadata::References::ClassMethods

Defined in:
lib/ronin/core/metadata/references.rb

Overview

Class-methods.

Instance Method Summary collapse

Instance Method Details

#references(new_references = nil) ⇒ Array<String>

Gets or sets the reference links.

Examples:

Set the references:

references [
  "https://...",
  ...
]

Get the reference links:

MyModule.references
# => ["https://...", ...]

Parameters:

  • new_references (Array<String>, nil) (defaults to: nil)

    The optional new reference links to set.

Returns:

  • (Array<String>)

    The previously set reference links.



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/ronin/core/metadata/references.rb', line 75

def references(new_references=nil)
  if new_references
    @references = if superclass.kind_of?(ClassMethods)
                    superclass.references + new_references
                  else
                    new_references
                  end
  else
    @references || if superclass.kind_of?(ClassMethods)
                     superclass.references
                   else
                     []
                   end
  end
end