Sha256: 85828f14878181bd8ce4434b4d7d586952cdb7d38c3d564ee799b644aa313356
Contents?: true
Size: 460 Bytes
Versions: 27
Compression:
Stored size: 460 Bytes
Contents
module Tw::App class Main def username?(arg) arg =~ /^@[a-zA-Z0-9_]+$/ ? arg.scan(/^@([a-zA-Z0-9_]+)$/)[0][0] : false end def listname?(arg) arg =~ /^@[a-zA-Z0-9_]+\/[a-zA-Z0-9_-]+$/ ? arg.scan(/^@([a-zA-Z0-9_]+)\/([a-zA-Z0-9_-]+)$/)[0] : false end def request?(arg) username?(arg) or listname?(arg) end def all_requests?(args) !args.map{|arg| request? arg}.include?(false) end end end
Version data entries
27 entries across 27 versions & 1 rubygems