Module: Medusa::Resource
- Includes:
- Uuidable
- Included in:
- Collection, Directory, File, FileGroup, Repository
- Defined in:
- lib/medusa/resource.rb
Overview
Instance Method Summary collapse
-
#exists? ⇒ Boolean
Whether the instance exists in Medusa.
-
#id ⇒ Integer
Medusa database ID.
-
#uuid ⇒ String
Medusa UUID.
Methods included from Uuidable
Instance Method Details
#exists? ⇒ Boolean
Returns Whether the instance exists in Medusa.
13 14 15 16 17 18 |
# File 'lib/medusa/resource.rb', line 13 def exists? load true rescue Medusa::NotFoundError false end |
#id ⇒ Integer
Returns Medusa database ID.
23 24 25 26 |
# File 'lib/medusa/resource.rb', line 23 def id load if @uuid && !@id @id end |
#uuid ⇒ String
Returns Medusa UUID.
31 32 33 34 |
# File 'lib/medusa/resource.rb', line 31 def uuid load if @id && !@uuid @uuid end |