Sha256: 3fd27a2dca54667f9800f1f7d64ec9ca28b49486dc7e5d5acc158e0cb774c0e6

Contents?: true

Size: 381 Bytes

Versions: 5

Compression:

Stored size: 381 Bytes

Contents

# frozen_string_literal: true

module Evostream
  # Send an action to evostream server
  class Action
    def initialize(payload)
      @payload = payload
    end

    def execute_action(command_name)
      cmd = command_name.sub(/^(\w)/, &:capitalize)
      klass = "Evostream::Commands::#{cmd}".constantize
      Evostream.send_command(klass.new(@payload).cmd)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
evostream-event-0.2.7 lib/evostream/event/action.rb
evostream-event-0.2.7.pre.44 lib/evostream/event/action.rb
evostream-event-0.2.6 lib/evostream/event/action.rb
evostream-event-0.2.6.pre.41 lib/evostream/event/action.rb
evostream-event-0.2.6.pre.39 lib/evostream/event/action.rb