Sha256: 877e830f97212643d78d86ea0b337566cac70bbd775b781cb828a7cd497f8784
Contents?: true
Size: 519 Bytes
Versions: 20
Compression:
Stored size: 519 Bytes
Contents
# frozen_string_literal: true module Spout module Models # Defines a continuous or discrete bucket for tables and graphs class Bucket attr_accessor :start, :stop def initialize(start, stop, discrete: false) @start = start @stop = stop @discrete = discrete end def in_bucket?(value) value >= @start && value <= @stop end def display_name return "#{@start}" if @discrete "#{@start} to #{@stop}" end end end end
Version data entries
20 entries across 20 versions & 1 rubygems