Class: FleetAPI::Mock

Inherits:
Object
  • Object
show all
Defined in:
lib/fleet_api/mock.rb

Class Method Summary collapse

Class Method Details

.random_idObject



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/fleet_api/mock.rb', line 7

def self.random_id
  existing_ids = []

  while true do
    id = SecureRandom.random_number(1000)
    unless existing_ids.include?(id)
      existing_ids << id
      return id
    end
  end
end

.random_nameObject



19
20
21
# File 'lib/fleet_api/mock.rb', line 19

def self.random_name
  SecureRandom.hex(6)
end

.uuidObject



3
4
5
# File 'lib/fleet_api/mock.rb', line 3

def self.uuid
  SecureRandom.uuid
end