Sha256: 6b2d87998e1831b211d4d0cc72ef62d6114e4455b2554972c861138e02a7c570
Contents?: true
Size: 703 Bytes
Versions: 23
Compression:
Stored size: 703 Bytes
Contents
module EY class CloudClient class ResolverResult attr_reader :api, :matches, :errors, :suggestions def initialize(api, matches, errors, suggestions) @api, @matches, @errors, @suggestions = api, matches, errors, suggestions end def one_match?() matches.size == 1 end def no_matches?() matches.empty? end def many_matches?() matches.size > 1 end def one_match(&block) one_match? && block && block.call(matches.first) end def no_matches(&block) no_matches? && block && block.call(errors, suggestions) end def many_matches(&block) many_matches? && block && block.call(matches) end end end end
Version data entries
23 entries across 23 versions & 1 rubygems