Class: Fog::AWS::SNS::Topic

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/aws/models/sns/topic.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject



26
27
28
29
30
# File 'lib/fog/aws/models/sns/topic.rb', line 26

def destroy
  requires :id
  service.delete_topic(id)
  true
end

#ready?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/fog/aws/models/sns/topic.rb', line 16

def ready?
  display_name
end

#saveObject



32
33
34
35
36
37
38
39
40
41
42
# File 'lib/fog/aws/models/sns/topic.rb', line 32

def save
  requires :id

  data = service.create_topic(id).body["TopicArn"]
  if data
    data = {"id" => data}
    merge_attributes(data)
    true
  else false
  end
end

#update_topic_attribute(attribute, new_value) ⇒ Object



20
21
22
23
24
# File 'lib/fog/aws/models/sns/topic.rb', line 20

def update_topic_attribute(attribute, new_value)
  requires :id
  service.set_topic_attributes(id, attribute, new_value).body
  reload
end