Class: Awspec::Helper::Finder::SNSTopic::SnsTopic
- Inherits:
-
Object
- Object
- Awspec::Helper::Finder::SNSTopic::SnsTopic
- Defined in:
- lib/awspec/helper/finder/sns_topic.rb
Instance Attribute Summary collapse
-
#confirmed_subscriptions ⇒ Object
readonly
to make testing results easier to the eyes instead of using Rspec include matcher for hashes.
-
#deleted_subscriptions ⇒ Object
readonly
to make testing results easier to the eyes instead of using Rspec include matcher for hashes.
-
#display_name ⇒ Object
readonly
to make testing results easier to the eyes instead of using Rspec include matcher for hashes.
-
#effective_delivery_policy ⇒ Object
readonly
to make testing results easier to the eyes instead of using Rspec include matcher for hashes.
-
#name ⇒ Object
readonly
to make testing results easier to the eyes instead of using Rspec include matcher for hashes.
-
#owner ⇒ Object
readonly
to make testing results easier to the eyes instead of using Rspec include matcher for hashes.
-
#pending_subscriptions ⇒ Object
readonly
to make testing results easier to the eyes instead of using Rspec include matcher for hashes.
-
#policy ⇒ Object
readonly
to make testing results easier to the eyes instead of using Rspec include matcher for hashes.
-
#topic_arn ⇒ Object
readonly
to make testing results easier to the eyes instead of using Rspec include matcher for hashes.
Instance Method Summary collapse
-
#initialize(attribs) ⇒ SnsTopic
constructor
A new instance of SnsTopic.
- #to_s ⇒ Object
Constructor Details
#initialize(attribs) ⇒ SnsTopic
Returns a new instance of SnsTopic.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/awspec/helper/finder/sns_topic.rb', line 10 def initialize(attribs) @policy = attribs['Policy'] @owner = attribs['Owner'] @pending_subscriptions = attribs['SubscriptionsPending'].to_i @topic_arn = attribs['TopicArn'] @effective_delivery_policy = attribs['EffectiveDeliveryPolicy'] @display_name = attribs['DisplayName'] @confirmed_subscriptions = attribs['SubscriptionsConfirmed'].to_i @deleted_subscriptions = attribs['SubscriptionsDeleted'].to_i @name = attribs['TopicArn'].split(':')[-1] end |
Instance Attribute Details
#confirmed_subscriptions ⇒ Object (readonly)
to make testing results easier to the eyes instead of using Rspec include matcher for hashes
7 8 9 |
# File 'lib/awspec/helper/finder/sns_topic.rb', line 7 def confirmed_subscriptions @confirmed_subscriptions end |
#deleted_subscriptions ⇒ Object (readonly)
to make testing results easier to the eyes instead of using Rspec include matcher for hashes
7 8 9 |
# File 'lib/awspec/helper/finder/sns_topic.rb', line 7 def deleted_subscriptions @deleted_subscriptions end |
#display_name ⇒ Object (readonly)
to make testing results easier to the eyes instead of using Rspec include matcher for hashes
7 8 9 |
# File 'lib/awspec/helper/finder/sns_topic.rb', line 7 def display_name @display_name end |
#effective_delivery_policy ⇒ Object (readonly)
to make testing results easier to the eyes instead of using Rspec include matcher for hashes
7 8 9 |
# File 'lib/awspec/helper/finder/sns_topic.rb', line 7 def effective_delivery_policy @effective_delivery_policy end |
#name ⇒ Object (readonly)
to make testing results easier to the eyes instead of using Rspec include matcher for hashes
7 8 9 |
# File 'lib/awspec/helper/finder/sns_topic.rb', line 7 def name @name end |
#owner ⇒ Object (readonly)
to make testing results easier to the eyes instead of using Rspec include matcher for hashes
7 8 9 |
# File 'lib/awspec/helper/finder/sns_topic.rb', line 7 def owner @owner end |
#pending_subscriptions ⇒ Object (readonly)
to make testing results easier to the eyes instead of using Rspec include matcher for hashes
7 8 9 |
# File 'lib/awspec/helper/finder/sns_topic.rb', line 7 def pending_subscriptions @pending_subscriptions end |
#policy ⇒ Object (readonly)
to make testing results easier to the eyes instead of using Rspec include matcher for hashes
7 8 9 |
# File 'lib/awspec/helper/finder/sns_topic.rb', line 7 def policy @policy end |
#topic_arn ⇒ Object (readonly)
to make testing results easier to the eyes instead of using Rspec include matcher for hashes
7 8 9 |
# File 'lib/awspec/helper/finder/sns_topic.rb', line 7 def topic_arn @topic_arn end |
Instance Method Details
#to_s ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/awspec/helper/finder/sns_topic.rb', line 22 def to_s output = ["SnsTopic: #{self.name}"] self.instance_variables.each do |attrib| tmp = attrib.to_s.sub('@', '') output << " #{tmp} = #{self.send(tmp)}" end output.join("\n") end |