Class: CreateGithubRelease::CommandLine::Validations::ValidateReleaseType Private

Inherits:
Base
  • Object
show all
Defined in:
lib/create_github_release/command_line/validations.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Validates that the given release type is valid

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from CreateGithubRelease::CommandLine::Validations::Base

Instance Method Details

#errorString+

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Called when valid? is false to return the error messages

Returns:

  • (String, Array<String>)


193
194
195
196
# File 'lib/create_github_release/command_line/validations.rb', line 193

def error
  valid_release_types = "'#{VALID_RELEASE_TYPES.join("', '")}'"
  "RELEASE_TYPE '#{options.release_type}' is not valid. Must be one of #{valid_release_types}"
end

#valid?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns true if the #release_type is nil or a valid release type

Returns:

  • (Boolean)


188
# File 'lib/create_github_release/command_line/validations.rb', line 188

def valid? = options.release_type.nil? || VALID_RELEASE_TYPES.include?(options.release_type)