Sha256: ff4188f96c3ba2e6e82c21955d8ab723a011d06707af0074e387616fd4898cb2
Contents?: true
Size: 538 Bytes
Versions: 5
Compression:
Stored size: 538 Bytes
Contents
module PactBroker module Config class SpaceDelimitedIntegerList < Array def initialize list super(list) end def self.integer?(string) (Integer(string) rescue nil) != nil end def self.parse(string) array = (string || '') .split(' ') .select { |word| integer?(word) } .collect(&:to_i) SpaceDelimitedIntegerList.new(array) end def to_s collect(&:to_s).join(' ') end end end end
Version data entries
5 entries across 5 versions & 1 rubygems