Class: AwsSnsKit::AwsClient
- Inherits:
-
Object
- Object
- AwsSnsKit::AwsClient
- Defined in:
- lib/aws_sns_kit/aws_client.rb
Instance Attribute Summary collapse
-
#client_wrapper ⇒ Object
readonly
Returns the value of attribute client_wrapper.
-
#instance ⇒ Object
readonly
Returns the value of attribute instance.
-
#notification ⇒ Object
readonly
Returns the value of attribute notification.
Instance Method Summary collapse
-
#initialize(instance, notification) ⇒ AwsClient
constructor
A new instance of AwsClient.
- #publish ⇒ Object
Constructor Details
#initialize(instance, notification) ⇒ AwsClient
Returns a new instance of AwsClient.
5 6 7 8 9 |
# File 'lib/aws_sns_kit/aws_client.rb', line 5 def initialize(instance, notification) @client_wrapper = AWS::SNS.new.client @instance = instance @notification = notification end |
Instance Attribute Details
#client_wrapper ⇒ Object (readonly)
Returns the value of attribute client_wrapper.
3 4 5 |
# File 'lib/aws_sns_kit/aws_client.rb', line 3 def client_wrapper @client_wrapper end |
#instance ⇒ Object (readonly)
Returns the value of attribute instance.
3 4 5 |
# File 'lib/aws_sns_kit/aws_client.rb', line 3 def instance @instance end |
#notification ⇒ Object (readonly)
Returns the value of attribute notification.
3 4 5 |
# File 'lib/aws_sns_kit/aws_client.rb', line 3 def notification @notification end |
Instance Method Details
#publish ⇒ Object
11 12 13 14 15 |
# File 'lib/aws_sns_kit/aws_client.rb', line 11 def publish client_wrapper.publish(target_arn: platform_endpoint, message: notification., message_structure: "json") rescue AWS::SNS::Errors::EndpointDisabled retry if enable end |