Class: Identifier::UUID::Random
- Inherits:
-
Object
- Object
- Identifier::UUID::Random
- Defined in:
- lib/identifier/uuid/random.rb
Defined Under Namespace
Modules: Substitute
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.configure(receiver, attr_name = nil) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/identifier/uuid/random.rb', line 16 def self.configure(receiver, attr_name=nil) instance = new if attr_name.nil? if receiver.respond_to?(:identifier) attr_name = :identifier else attr_name = :uuid end end receiver.send "#{attr_name}=", instance instance end |
.get ⇒ Object
8 9 10 |
# File 'lib/identifier/uuid/random.rb', line 8 def self.get UUID.format(raw) end |
.raw ⇒ Object
12 13 14 |
# File 'lib/identifier/uuid/random.rb', line 12 def self.raw SecureRandom.uuid end |
Instance Method Details
#get ⇒ Object
4 5 6 |
# File 'lib/identifier/uuid/random.rb', line 4 def get self.class.get end |