Sha256: 3064553b408df64d91e28c8c0700b48e5fa3f5d672646bbcf65046abf5faa625

Contents?: true

Size: 485 Bytes

Versions: 4

Compression:

Stored size: 485 Bytes

Contents

require "magellan/cli/messaging"

module Magellan
  module Cli
    module Messaging
      class Mqtt < Magellan::Cli::Messaging::Base

        desc "pub TOPIC PAYLOAD", I18n.t(:pub, scope: [:messaging, :mqtt])
        def pub(topic, payload)
          core.publish(topic, try_reading_file(payload))
        end

        desc "get [TOPIC]", I18n.t(:get, scope: [:messaging, :mqtt])
        def get(topic = nil)
          core.get_message(topic)
        end

      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
magellan-cli-0.5.3 lib/magellan/cli/messaging/mqtt.rb
magellan-cli-0.5.2 lib/magellan/cli/messaging/mqtt.rb
magellan-cli-0.5.1 lib/magellan/cli/messaging/mqtt.rb
magellan-cli-0.5.0 lib/magellan/cli/messaging/mqtt.rb