Module: Ronin::Core::Metadata::Description::ClassMethods

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

Overview

Class-methods.

Instance Method Summary collapse

Instance Method Details

#description(new_description = nil) ⇒ String?

Gets or sets the description.

Examples:

Setting the description:

description <<~DESC
  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
  eiusmod tempor incididunt ut labore et dolore magna aliqua.

  Ut enim ad minim veniam, quis nostrud exercitation ullamco
  laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
  dolor in reprehenderit in voluptate velit esse cillum dolore eu

  fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
  proident, sunt in culpa qui officia deserunt mollit anim id est
  laborum.
DESC

Getting the description:

MyModule.description

Parameters:

  • new_description (String, nil) (defaults to: nil)

    The optional new description text to set.

Returns:

  • (String, nil)

    The previously set description text.



90
91
92
93
94
95
96
97
98
# File 'lib/ronin/core/metadata/description.rb', line 90

def description(new_description=nil)
  if new_description
    @description = new_description
  else
    @description || if superclass.kind_of?(ClassMethods)
                      superclass.description
                    end
  end
end