This is the list of official plugins. You can install them by RubyGems and you can use new declaration keywords by installing.
neuroncheck-not_empty
It adds not_empty
keyword and aliases of it – nonempty
and non-empty
. It checks by empty?
method whether passed argument or return value is non-empty value.
% gem install neuroncheck-not_empty
require 'neuroncheck/plugin/not_empty'
class Converter
extend NeuronCheck
ndecl {
args not_empty(String) # '' or not String object raises error
}
def convert_file(file_path)
end
end
args not_empty(Array) #=> non-empty Array check
args not_empty(Hash) #=> non-empty Hash check
args not_empty(array_of(String)) #=> non-empty Array consisting of String check
# aliases
args nonempty(String)
args non_empty(String)
neuroncheck-present
It adds present
keyword. It checks by present?
method of ActiveSupport whether passed argument or return value is non-blank value.
% gem install neuroncheck-present
require 'neuroncheck/plugin/present'
class Converter
extend NeuronCheck
ndecl {
args present(String) #=> '' or ' ' (only space) raises error
}
def convert_file(file_path)
end
end
args present(Array) #=> non-empty Array check
args present(Hash) #=> non-empty Hash check
blank
keyword, because it seems to have almost no use opportunities in NeuronCheck compared with present
, haven’t been added.
neuroncheck-boolean
It adds boolean
keyword. It equals [true, false]
.
% gem install neuroncheck-boolean
require 'neuroncheck/plugin/boolean'
class Document
extend NeuronCheck
ndecl {
returns boolean #=> equals [true, false]
}
def loaded?
end
end