Sha256: 6cbed4f2f439692b7d2d45f650e51bb4d627c8bf0bcae07e45cdfab5638e2b9c

Contents?: true

Size: 605 Bytes

Versions: 27

Compression:

Stored size: 605 Bytes

Contents

class Verdict::Group
  include Verdict::Metadata

  attr_reader :experiment, :handle

  def initialize(experiment, handle)
    @experiment, @handle = experiment, handle.to_s
  end

  def to_s
    handle
  end

  def to_sym
    handle.to_sym
  end

  def ===(other)
    case other
      when Verdict::Group; experiment == other.experiment && other.handle == handle
      when Symbol, String; handle == other.to_s
      else false
    end
  end

  def as_json(options = {})
    {
      handle: handle,
      metadata: metadata
    }
  end

  def to_json(options = {})
    as_json(options).to_json
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
verdict-0.16.1 lib/verdict/group.rb
verdict-0.16.0 lib/verdict/group.rb
verdict-0.15.2 lib/verdict/group.rb
verdict-0.15.1 lib/verdict/group.rb
verdict-0.15.0 lib/verdict/group.rb
verdict-0.14.0 lib/verdict/group.rb
verdict-0.13.0 lib/verdict/group.rb
verdict-0.12.0 lib/verdict/group.rb
verdict-0.11.0 lib/verdict/group.rb
verdict-0.10.0 lib/verdict/group.rb
verdict-0.9.0 lib/verdict/group.rb
verdict-0.8.0 lib/verdict/group.rb
verdict-0.7.0 lib/verdict/group.rb
verdict-0.6.3 lib/verdict/group.rb
verdict-0.6.2 lib/verdict/group.rb
verdict-0.6.1 lib/verdict/group.rb
verdict-0.6.0 lib/verdict/group.rb
verdict-0.5.0 lib/verdict/group.rb
verdict-0.4.1 lib/verdict/group.rb
verdict-0.4.0 lib/verdict/group.rb