class Freno::Client::Preconditions::Checker

Attributes

errors[R]

Public Class Methods

new() click to toggle source
# File lib/freno/client/preconditions.rb, line 11
def initialize
  @errors = []
end

Public Instance Methods

present(args = {}) click to toggle source
# File lib/freno/client/preconditions.rb, line 15
def present(args = {})
  args.each do |arg, value|
    unless value
      errors << "#{arg} should be present"
    end
  end
end
report() click to toggle source
# File lib/freno/client/preconditions.rb, line 23
def report
  raise PreconditionNotMet.new(errors.join("\n")) unless errors.empty?
end