Module: Ronin::Core::Metadata::Authors::ClassMethods

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

Overview

Class-methods.

Instance Method Summary collapse

Instance Method Details

#author(name, **kwargs) ⇒ Object

Adds an author.

Examples:

Adds an author name:

author 'John Smith'

Adds an author name and email:

author 'John Smith', email: 'john.smith@example.com'

Parameters:

  • name (String, nil)

    The new author name to add.

  • kwargs (Hash{Symbol => Object})

    Additional keyword arguments for Author#initialize.

Options Hash (**kwargs):

  • :email (String, nil)

    The author's email.

  • :pgp (String, nil)

    The author's PGP Key ID.

  • :website (String, nil)

    The author's website.

  • :blog (String, nil)

    The author's blog.

  • :github (String, nil)

    The author's GitHub user name.

  • :gitlab (String, nil)

    The author's GitLab user name.

  • :twitter (String, nil)

    The author's Twitter handle.

  • :mastodon (String, nil)

    The author's Mastodon handle.

  • :discord (String, nil)

    The author's Discord handle.



119
120
121
# File 'lib/ronin/core/metadata/authors.rb', line 119

def author(name,**kwargs)
  authors << Ronin::Core::Metadata::Authors::Author.new(name,**kwargs)
end

#authorsArray<Authors::Author>

The authors associated with the class.

Returns:



67
68
69
70
71
72
73
# File 'lib/ronin/core/metadata/authors.rb', line 67

def authors
  @authors ||= if superclass.kind_of?(ClassMethods)
                 superclass.authors.dup
               else
                 []
               end
end