Class: Fog::SakuraCloud::Script::Note

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/sakuracloud/models/script/note.rb

Instance Method Summary collapse

Instance Method Details

#deleteObject Also known as: destroy



18
19
20
21
# File 'lib/fog/sakuracloud/models/script/note.rb', line 18

def delete
  service.delete_note(identity)
  true
end

#saveObject



24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/fog/sakuracloud/models/script/note.rb', line 24

def save
  requires :name, :content
  if identity
    Fog::Logger.warning("Update Note #{identity}")
    data = service.modify_note(@attributes).body["Note"]
  else
    Fog::Logger.warning("Create New Note")
    data = service.create_note(@attributes).body["Note"]
  end
  merge_attributes(data)
  true
end