Sha256: 3de7ca16a020920450c0d36cc8fe4e5970c35ce3b4af2ccccdec6416b5750093

Contents?: true

Size: 595 Bytes

Versions: 1

Compression:

Stored size: 595 Bytes

Contents

# frozen_string_literal: true

module RSpeed
  module Variable
    module_function

    DEFAULT_PATTERN = 'rspeed_*'
    PIPES_PATTERN   = 'rspeed_pipe_*'
    PROFILE_PATTERN = 'rspeed_profile_*'

    def append_name(value, suffix = nil)
      [value, RSpeed::Env.name, suffix].compact.join('_')
    end

    def key(number)
      append_name('rspeed', number).to_sym
    end

    def result
      append_name('rspeed')
    end

    def pipe_name
      append_name('rspeed_pipe', RSpeed::Env.pipe)
    end

    def profile
      append_name('rspeed_profile', RSpeed::Env.pipe)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rspeed-0.5.2 lib/rspeed/variable.rb