Class: Micro::Cases::Map

Inherits:
Object
  • Object
show all
Defined in:
lib/micro/cases/map.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(use_cases) ⇒ Map

Returns a new instance of Map.



18
19
20
# File 'lib/micro/cases/map.rb', line 18

def initialize(use_cases)
  @use_cases = use_cases
end

Instance Attribute Details

#use_casesObject (readonly)

Returns the value of attribute use_cases.



10
11
12
# File 'lib/micro/cases/map.rb', line 10

def use_cases
  @use_cases
end

Class Method Details

.build(args) ⇒ Object



12
13
14
15
16
# File 'lib/micro/cases/map.rb', line 12

def self.build(args)
  raise Error::InvalidUseCases unless HasValidArgs[args]

  new(args)
end

Instance Method Details

#call(arg = {}) ⇒ Object



32
33
34
35
36
# File 'lib/micro/cases/map.rb', line 32

def call(arg = {})
  hash = Kind::Hash[arg]

  use_cases.map(&GetUseCaseResult[hash])
end