require_relative "base"
module Validators
  module FieldValidator
    class Flavor < Base

      def valid?
        @model.provider_instance.flavors.detect do |flavor|
          flavor['id'] == @value
        end
      end

      def message
        "Invalid flavor '#{@value}'."
      end
    end
  end
end

