class AwsIotDevice::MqttShadowClient::TopicBuilder
Public Class Methods
new(shadow_name)
click to toggle source
# File lib/aws_iot_device/mqtt_shadow_client/topic_builder.rb, line 4 def initialize(shadow_name) raise ArgumentError, "topic_builder initialization, shadow_name is required but undefined" if shadow_name.nil? @shadow_name = shadow_name @topic_delta = "$aws/things/#{shadow_name}/shadow/update/delta" @topic_general = "$aws/things/#{shadow_name}/shadow/" end
Public Instance Methods
get_topic_accepted(action)
click to toggle source
# File lib/aws_iot_device/mqtt_shadow_client/topic_builder.rb, line 22 def get_topic_accepted(action) get_topic_general(action) + "/accepted" end
get_topic_delta()
click to toggle source
# File lib/aws_iot_device/mqtt_shadow_client/topic_builder.rb, line 30 def get_topic_delta @topic_delta end
get_topic_general(action)
click to toggle source
# File lib/aws_iot_device/mqtt_shadow_client/topic_builder.rb, line 17 def get_topic_general(action) raise ArgumentError, "topic_builder, get topic, unreconized action_name \"#{action}\"" unless ACTION_NAME.include?(action) @topic_general + action end
get_topic_rejected(action)
click to toggle source
# File lib/aws_iot_device/mqtt_shadow_client/topic_builder.rb, line 26 def get_topic_rejected(action) get_topic_general(action) + "/rejected" end
is_delta?(action)
click to toggle source
# File lib/aws_iot_device/mqtt_shadow_client/topic_builder.rb, line 13 def is_delta?(action) action == ACTION_NAME[3] end