Sha256: cc2bfe794e7d54fc0dc9f361bd8949cd4a478ad362747a0e38eb2b26919892bd

Contents?: true

Size: 386 Bytes

Versions: 2

Compression:

Stored size: 386 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

2 entries across 2 versions & 1 rubygems

Version Path
evostream-event-0.3.0 lib/evostream/event/action.rb
evostream-event-0.3.0.pre.48 lib/evostream/event/action.rb