Sha256: 10d6a7344479109a7aefc1785a1c1e02fa0b2434325861d8c4a621f06fa261e1
Contents?: true
Size: 542 Bytes
Versions: 14
Compression:
Stored size: 542 Bytes
Contents
class Array ## # Split _string_ into an array. Used in # conjunction with Highline's #ask, or #ask_for_array # methods, which must respond to #parse. # # This method allows escaping of whitespace. For example # the arguments foo bar\ baz will become ['foo', 'bar baz'] # # === Example # # # ask invokes Array#parse # list = ask 'Favorite cookies:', Array # # # or use ask_for_CLASS # list = ask_for_array 'Favorite cookies: ' # def self.parse string eval "%w(#{string})" end end
Version data entries
14 entries across 14 versions & 3 rubygems