Module: Micro

Defined in:
lib/micro/case.rb,
lib/micro/cases.rb,
lib/micro/case/safe.rb,
lib/micro/cases/map.rb,
lib/micro/case/error.rb,
lib/micro/cases/flow.rb,
lib/micro/case/config.rb,
lib/micro/case/result.rb,
lib/micro/case/strict.rb,
lib/micro/cases/error.rb,
lib/micro/cases/utils.rb,
lib/micro/case/version.rb,
lib/micro/cases/safe/flow.rb,
lib/micro/case/result/wrapper.rb,
lib/micro/case/result/transitions.rb,
lib/micro/case/with_activemodel_validation.rb

Defined Under Namespace

Modules: Cases Classes: Case

Class Method Summary collapse

Class Method Details

.case?(arg) ⇒ Boolean

Returns:

  • (Boolean)


282
283
284
# File 'lib/micro/case.rb', line 282

def self.case?(arg)
  arg.is_a?(Class) && arg < Case
end

.case_or_flow?(arg) ⇒ Boolean

Returns:

  • (Boolean)


286
287
288
# File 'lib/micro/case.rb', line 286

def self.case_or_flow?(arg)
  case?(arg) || arg.is_a?(Cases::Flow)
end