Sha256: 593145966f5749451c0e5533a5358ee76fc225c6c4fd2dad8198588e347f326b
Contents?: true
Size: 1.25 KB
Versions: 50
Compression:
Stored size: 1.25 KB
Contents
module Eco module API class Session class Config class PostLaunch < BaseConfig include Enumerable def initialize(config:) @postcases = [] super(config: config) end def length count end def empty? count == 0 end def each(params: {}, &block) return to_enum(:each) unless block items.each(&block) end def items @postcases end def add(name, type: nil) @postcases.push({ name: name, type: type }) end def select(usecases) raise "Required Eco::API::UseCases to select the target post cases" unless usecases.is_a?(Eco::API::UseCases) each_with_object([]) do |pc, targets| targets.push(usecases.case(pc[:name], type: pc[:type])) end end private def by_name @postcases.group_by {|pc| pc[:name]} end def by_type @postcases.group_by {|pc| pc[:type]} end end end end end end
Version data entries
50 entries across 50 versions & 1 rubygems