Class: QiitaMatome::Validators::ArticlesValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/validators/articles_validator.rb

Overview

ArticlesValidator

Constant Summary collapse

ARTICLES_CLASS_ERROR =

rubocop:disable LineLength

"invalid argument class '%s'. articles must be Array"

Class Method Summary collapse

Class Method Details

.validate(articles) ⇒ Object



10
11
12
13
# File 'lib/validators/articles_validator.rb', line 10

def self.validate(articles)
  return if articles.is_a?(Array)
  fail ArgumentError, format(ARTICLES_CLASS_ERROR, articles.class)
end