Class: Namespaces::RandomizedSuffixPath

Inherits:
Object
  • Object
show all
Defined in:
app/models/namespaces/randomized_suffix_path.rb

Constant Summary collapse

MAX_TRIES =
4
LEADING_ZEROS =
/^0+/

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ RandomizedSuffixPath

Returns a new instance of RandomizedSuffixPath.



8
9
10
# File 'app/models/namespaces/randomized_suffix_path.rb', line 8

def initialize(path)
  @path = path
end

Instance Method Details

#call(new_count) ⇒ Object



12
13
14
15
# File 'app/models/namespaces/randomized_suffix_path.rb', line 12

def call(new_count)
  @count = new_count.to_i
  to_s
end

#to_sObject



17
18
19
# File 'app/models/namespaces/randomized_suffix_path.rb', line 17

def to_s
  "#{path}#{suffix}"
end