Class: EPIC::Profile::UUID

Inherits:
EPIC::Profile show all
Defined in:
src/epic_profile.rb

Overview

A profile that uses UUIDs to guarantee the uniqueness of created Handles.

Constant Summary

Constant Summary

Constants inherited from Resource

Resource::GLOBAL_LOCK_HASH, Resource::GLOBAL_LOCK_MUTEX

Instance Attribute Summary

Attributes inherited from EPIC::Profile

#description

Attributes included from Rackful::Resource

#get_etag, #get_last_modified, #path

Instance Method Summary (collapse)

Methods inherited from EPIC::Profile

[], inherited, profiles, #to_rackful

Methods inherited from Resource

#lock, lock, #unlock, #xhtml

Methods included from Rackful::Resource

#default_headers, #destroy, #do_METHOD, #empty?, #http_DELETE, #http_GET, #http_HEAD, #http_OPTIONS, #http_PUT, #http_method, #http_methods, included, #requested?, #serializer, #title, #to_rackful, #to_struct

Constructor Details

- (UUID) initialize(*args)

A new instance of UUID



60
61
62
63
64
65
66
67
# File 'src/epic_profile.rb', line 60

def initialize *args
  super( *args )
  @parameters = {
    :prefix => 'Optional: a string of UTF-8 encoded printable unicode characters to put before the UUID.',
    :suffix => 'Optional: a string of UTF-8 encoded printable unicode characters to put after the UUID.'
  }
  @description = 'This profile uses UUIDs to guarantee the uniqueness of created Handles.'
end

Instance Method Details

- (void) validate(request)



69
70
71
72
73
# File 'src/epic_profile.rb', line 69

def validate request
  prefix = request.GET['prefix'] || ''
  suffix = request.GET['suffix'] || ''
  prefix + DB.instance.uuid + suffix
end