Sha256: 239a77e370881fc2e3f468f98c3f7b51650e00d9ca89f6cb0d657b83d5f85a84
Contents?: true
Size: 796 Bytes
Versions: 13
Compression:
Stored size: 796 Bytes
Contents
module Eco module API class UseCases # Core class of UseCases. It basically defines and manages allowed `types` 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, :other] 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