Module: Credly::Requierable

Included in:
Api::Base, Client
Defined in:
lib/credly/requierable.rb

Instance Method Summary collapse

Instance Method Details

#require_at_least_one_file(options, *args) ⇒ Object



9
10
11
12
13
# File 'lib/credly/requierable.rb', line 9

def require_at_least_one_file(options, *args)
  args.each do |argument|
    raise ArgumentError.new('There should be at least one file') if options[argument].empty?
  end
end

#require_present(options, *args) ⇒ Object



3
4
5
6
7
# File 'lib/credly/requierable.rb', line 3

def require_present(options, *args)
  args.each do |argument|
    raise ArgumentError.new("Argument #{argument} is required") if options[argument].nil?
  end
end