Class: GxApi::GenericIdentifier

Inherits:
Object
  • Object
show all
Defined in:
lib/gxapi/experiment_identifier.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ GenericIdentifier

Constructor

Parameters:

  • value (String)

    Value string



71
72
73
# File 'lib/gxapi/experiment_identifier.rb', line 71

def initialize(value)
  @value = value.to_s
end

Instance Attribute Details

#valueObject

Returns the value of attribute value.



65
66
67
# File 'lib/gxapi/experiment_identifier.rb', line 65

def value
  @value
end

Instance Method Details

#to_keyString

Turn our value into a cache key

Returns:

  • (String)

    Key for caching



79
80
81
# File 'lib/gxapi/experiment_identifier.rb', line 79

def to_key
  self.value.downcase.gsub(/[^\w\d]+/,'_')
end