Sha256: e3ddca810b607268f5800c575bd3cafffc62e324d5073b1df663517b0f357e0b
Contents?: true
Size: 698 Bytes
Versions: 22
Compression:
Stored size: 698 Bytes
Contents
module RSMP # Class that matches a single status or command item class Query attr_reader :want, :got, :message def initialize want @want = want @got = nil @message = nil @done = false end # Are we done, i.e. did the last checked item match? def done? @done end # Check an item and set @done to true if it matches # Store the item and corresponding message if there's a positive or negative match def check_match item, message matched = match? item if matched != nil @message = message @got = item @done = matched end matched end def match? item end end end
Version data entries
22 entries across 22 versions & 1 rubygems