Module: CommandKit::Options::Version::ClassMethods

Defined in:
lib/command_kit/options/version.rb

Overview

Defines class-level methods.

Instance Method Summary collapse

Instance Method Details

#version(new_version = nil) ⇒ String?

Gets or sets the version string.

Parameters:

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

    If given a new version String, it will set the class'es version string.

Returns:

  • (String, nil)

    The classes version string.



52
53
54
55
56
57
58
# File 'lib/command_kit/options/version.rb', line 52

def version(new_version=nil)
  if new_version
    @version = new_version
  else
    @version || (superclass.version if superclass.kind_of?(ClassMethods))
  end
end