Sha256: 28c98296a38d4218d01b109196e81758b96e81fce4d2c30c2d5210ed5bbf2773

Contents?: true

Size: 819 Bytes

Versions: 1

Compression:

Stored size: 819 Bytes

Contents

module Flipper
  # Private: Used internally in flipper to create key to be used for feature in
  # the adapter. You should never need to use this.
  class Key
    # Private
    Separator = '/'

    # Private
    attr_reader :feature_name

    # Private
    attr_reader :gate_key

    # Internal
    def initialize(feature_name, gate_key)
      @feature_name, @gate_key = feature_name, gate_key
    end

    # Private
    def separator
      Separator.dup
    end

    # Private
    def to_s
      "#{feature_name}#{separator}#{gate_key}"
    end

    # Internal: Pretty string version for debugging.
    def inspect
      attributes = [
        "feature_name=#{feature_name.inspect}",
        "gate_key=#{gate_key.inspect}",
      ]
      "#<#{self.class.name}:#{object_id} #{attributes.join(', ')}>"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
flipper-0.4.0 lib/flipper/key.rb