Class: ZSS::Require::Requirer

Inherits:
Object
  • Object
show all
Defined in:
lib/zss/require.rb

Class Method Summary collapse

Class Method Details

.requires(params, attributes) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/zss/require.rb', line 6

def self.requires params, attributes
  Array(attributes).each do |attribute|
    unless params[attribute].present?
      raise ZSS::Error.new(400, "Invalid parameter '#{attribute}'")
    end
  end
end