Sha256: 96630d11fad066b74a0021d8f574c9f1fef70452b557294da4d28e57cff5dda9
Contents?: true
Size: 706 Bytes
Versions: 13
Compression:
Stored size: 706 Bytes
Contents
module Eco module API class UseCases class BaseCase class InvalidType < Exception def initialize(msg = nil, type:, types:) msg ||= "Invalid type." msg = "Given type '#{type}'. Valid types: #{types}" super(msg) end end @types = [:import, :filter, :transform, :sync, :export] class << self attr_reader :types def valid_type?(type) types.include?(type) end def validate_type(type) raise InvalidType.new(type: type, types: types) unless valid_type?(type) end end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems