Class: Fastlane::Helper::AwsSns
- Inherits:
-
Object
- Object
- Fastlane::Helper::AwsSns
- Defined in:
- lib/fastlane/plugin/aws_sns_topic/helper/aws_sns_topic_helper.rb
Instance Method Summary collapse
-
#initialize(access_key, secret_access_key, region, topic_arn) ⇒ AwsSns
constructor
A new instance of AwsSns.
- #publish_message(message, subject) ⇒ Object
Constructor Details
#initialize(access_key, secret_access_key, region, topic_arn) ⇒ AwsSns
Returns a new instance of AwsSns.
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/fastlane/plugin/aws_sns_topic/helper/aws_sns_topic_helper.rb', line 20 def initialize(access_key, secret_access_key, region, topic_arn) @client = Aws::SNS::Client.new( access_key_id: access_key, secret_access_key: secret_access_key, region: region ) @topic = Aws::SNS::Topic.new( arn: topic_arn, client: @client ) end |
Instance Method Details
#publish_message(message, subject) ⇒ Object
32 33 34 35 36 37 38 39 |
# File 'lib/fastlane/plugin/aws_sns_topic/helper/aws_sns_topic_helper.rb', line 32 def (, subject) @topic.publish({ message: , subject: subject }) rescue => error UI.crash!("Send SNS topic message error: #{error.inspect}") end |