Sha256: 8ad5d0e4af7a9de8c22c5c5bad5a5dcdd6f456caad8b05e9a6c660deaec1a67f
Contents?: true
Size: 968 Bytes
Versions: 36
Compression:
Stored size: 968 Bytes
Contents
# Author:: Eric Crane (mailto:eric.crane@mac.com) # Copyright:: Copyright (c) 2020 Eric Crane. All rights reserved. # # An action is a message sent to an object with optional parameters. # module Gloo module Exec class Action attr_accessor :msg, :to, :params # # Set up the action. # def initialize( msg, to, params = nil ) @msg = msg @to = to @params = params end # # The action is valid if the object can receive # the message specified. # def valid? return @to.can_receive_message?( @msg ) end # # Execute the action. # Dispatch the message to the object. # def dispatch @to.send_message @msg, @params end # # Generic function to get display value. # Can be used for debugging, etc. # def display_value return "#{@msg} -> #{@to.pn}" end end end end
Version data entries
36 entries across 36 versions & 1 rubygems