Class: FakeSNS::Actions::GetTopicAttributes

Inherits:
FakeSNS::Action show all
Defined in:
lib/fake_sns/actions/get_topic_attributes.rb

Instance Attribute Summary collapse

Attributes inherited from FakeSNS::Action

#db, #params

Instance Method Summary collapse

Methods inherited from FakeSNS::Action

#initialize, param

Constructor Details

This class inherits a constructor from FakeSNS::Action

Instance Attribute Details

#topicObject (readonly)

TopicArn Owner Policy DisplayName SubscriptionsPending SubscriptionsConfirmed SubscriptionsDeleted DeliveryPolicy EffectiveDeliveryPolicy



17
18
19
# File 'lib/fake_sns/actions/get_topic_attributes.rb', line 17

def topic
  @topic
end

Instance Method Details

#callObject



19
20
21
# File 'lib/fake_sns/actions/get_topic_attributes.rb', line 19

def call
  @topic = db.topics.fetch(arn) { raise NotFound, arn }
end

#each_attribute {|"TopicArn", arn| ... } ⇒ Object

Yields:

  • ("TopicArn", arn)


23
24
25
26
27
28
# File 'lib/fake_sns/actions/get_topic_attributes.rb', line 23

def each_attribute
  yield "TopicArn", arn
  %w(DisplayName Policy DeliveryPolicy).each do |key|
    yield key, topic[key] if topic.has_key?(key)
  end
end