Module: RSpeed::Variable

Defined in:
lib/rspeed/variable.rb

Constant Summary collapse

PIPES_PATTERN =
'rspeed:pipe_*'
PROFILE_PATTERN =
'rspeed:profile_*'

Class Method Summary collapse

Class Method Details

.append_app_name(value, plus: nil) ⇒ Object



10
11
12
# File 'lib/rspeed/variable.rb', line 10

def append_app_name(value, plus: nil)
  [value, RSpeed::Env.app, plus].compact.join('_')
end

.key(number) ⇒ Object



14
15
16
# File 'lib/rspeed/variable.rb', line 14

def key(number)
  append_app_name('rspeed', plus: number).to_sym
end

.pipeObject



22
23
24
# File 'lib/rspeed/variable.rb', line 22

def pipe
  append_app_name('rspeed:pipe', plus: format('%02d', RSpeed::Env.pipe))
end

.previous_resultObject



26
27
28
# File 'lib/rspeed/variable.rb', line 26

def previous_result
  append_app_name('rspeed', plus: 'previous')
end

.profileObject



30
31
32
# File 'lib/rspeed/variable.rb', line 30

def profile
  append_app_name('rspeed:profile', plus: format('%02d', RSpeed::Env.pipe))
end

.resultObject



18
19
20
# File 'lib/rspeed/variable.rb', line 18

def result
  append_app_name('rspeed')
end