Class: Eco::API::Session::Config::PostLaunch
- Inherits:
-
BaseConfig
show all
- Includes:
- Enumerable
- Defined in:
- lib/eco/api/session/config/post_launch.rb
Instance Attribute Summary
Attributes inherited from BaseConfig
#config
#logger
Instance Method Summary
collapse
Methods inherited from BaseConfig
#apis, attr_key, #clone, #file_manager
#log
Methods inherited from Hash
#deep_merge, #deep_merge!
Constructor Details
#initialize(config:) ⇒ PostLaunch
Returns a new instance of PostLaunch.
8
9
10
11
|
# File 'lib/eco/api/session/config/post_launch.rb', line 8
def initialize(config:)
super
@postcases = []
end
|
Instance Method Details
#add(name, type: nil) ⇒ Object
31
32
33
34
35
36
|
# File 'lib/eco/api/session/config/post_launch.rb', line 31
def add(name, type: nil)
@postcases.push({
name: name,
type: type
})
end
|
#each(&block) ⇒ Object
21
22
23
24
25
|
# File 'lib/eco/api/session/config/post_launch.rb', line 21
def each(&block)
return to_enum(:each) unless block
items.each(&block)
end
|
#empty? ⇒ Boolean
17
18
19
|
# File 'lib/eco/api/session/config/post_launch.rb', line 17
def empty?
count.zero?
end
|
27
28
29
|
# File 'lib/eco/api/session/config/post_launch.rb', line 27
def items
@postcases
end
|
13
14
15
|
# File 'lib/eco/api/session/config/post_launch.rb', line 13
def length
count
end
|
#select(usecases) ⇒ Object
38
39
40
41
42
43
44
45
46
|
# File 'lib/eco/api/session/config/post_launch.rb', line 38
def select(usecases)
msg = 'Required Eco::API::UseCases to select the target post cases. '
msg << "Given: #{usecases.class}."
raise msg unless usecases.is_a?(Eco::API::UseCases)
each_with_object([]) do |pc, targets|
targets.push(usecases.case(pc[:name], type: pc[:type]))
end
end
|