Class: FakeSNS::Actions::CreateTopic
Instance Attribute Summary collapse
#db, #params
Instance Method Summary
collapse
#initialize, param
Instance Attribute Details
#topic ⇒ Object
Returns the value of attribute topic.
20
21
22
|
# File 'lib/fake_sns/actions/create_topic.rb', line 20
def topic
@topic
end
|
Instance Method Details
#arn ⇒ Object
16
17
18
|
# File 'lib/fake_sns/actions/create_topic.rb', line 16
def arn
topic["arn"]
end
|
#call ⇒ Object
11
12
13
14
|
# File 'lib/fake_sns/actions/create_topic.rb', line 11
def call
raise InvalidParameterValue, "Topic Name: #{name.inspect}" unless valid_name?
@topic = (existing_topic || new_topic)
end
|
#valid_name? ⇒ Boolean
7
8
9
|
# File 'lib/fake_sns/actions/create_topic.rb', line 7
def valid_name?
name =~ /\A[\w\-]+\z/
end
|