class Stattleship::Validators::StatValidator

Public Instance Methods

validate() click to toggle source
# File lib/stattleship/validators/stat_validator.rb, line 4
def validate
  if present?(value) && present?(stat_type)
    return
  end

  if blank?(value)
    raise ArgumentError.new('expected stat')
  end

  raise ArgumentError.new('expected stat and type')
end

Private Instance Methods

stat_type() click to toggle source
# File lib/stattleship/validators/stat_validator.rb, line 18
def stat_type
  params['type']
end