Module: Eco::API::Common::Loaders::UseCase::Type::ClassMethods

Defined in:
lib/eco/api/common/loaders/use_case/type.rb

Instance Method Summary collapse

Instance Method Details

#type(value = nil) ⇒ Symbol

Returns the type of usecase (i.e. :sync, :transform, :import, :other).

Returns:

  • (Symbol)

    the type of usecase (i.e. :sync, :transform, :import, :other)



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/eco/api/common/loaders/use_case/type.rb', line 13

def type(value = nil)
  return @type = value if value
  return @type         if @type

  types_sym_str = available_types.map do |tp|
    ":#{tp}"
  end.join(', ')

  msg  = "You should specify a type of case "
  msg << "[#{types_sym_str}] for #{self}"
  raise msg
end