Module: Ronin::Core::Metadata::ID::ClassMethods

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

Overview

Class-methods.

Instance Method Summary collapse

Instance Method Details

#id(new_id = nil) ⇒ String?

Gets or sets the class id.

Examples:

Setting the class id:

class MyClass
  include Ronin::Core::Metadata::ID
  id 'my_class'
end

Getting the class id:

MyClass.id
# => "my_class"

Parameters:

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

    The optional new class id to set.

Returns:

  • (String, nil)

    The previously set class id.



71
72
73
74
75
# File 'lib/ronin/core/metadata/id.rb', line 71

def id(new_id=nil)
  if new_id then @id = new_id
  else           @id
  end
end