Class: TrailGuide::Metrics::Checkpoint

Inherits:
Goal
  • Object
show all
Defined in:
lib/trail_guide/metrics/checkpoint.rb

Overview

represents a checkpoint in a funnel TODO this is mostly a placeholder for now

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Goal

#==, #===, #allow_conversion?, #configuration, #configure, #run_callbacks, #storage_key, #to_s

Constructor Details

#initialize(experiment, name, checkpoints = []) ⇒ Checkpoint

Returns a new instance of Checkpoint.



12
13
14
15
# File 'lib/trail_guide/metrics/checkpoint.rb', line 12

def initialize(experiment, name, checkpoints=[])
  @experiment = experiment
  @name = name.to_s.underscore.to_sym
end

Instance Attribute Details

#experimentObject (readonly)

Returns the value of attribute experiment.



6
7
8
# File 'lib/trail_guide/metrics/checkpoint.rb', line 6

def experiment
  @experiment
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/trail_guide/metrics/checkpoint.rb', line 6

def name
  @name
end

Instance Method Details

#as_json(opts = {}) ⇒ Object



17
18
19
20
21
# File 'lib/trail_guide/metrics/checkpoint.rb', line 17

def as_json(opts={})
  {
    name: name,
  }
end

#dup(experiment) ⇒ Object



8
9
10
# File 'lib/trail_guide/metrics/checkpoint.rb', line 8

def dup(experiment)
  self.class.new(experiment, name)
end