Class: SimpleStatistics::DataSet

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_statistics/data_set.rb

Defined Under Namespace

Classes: DataFinder

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDataSet

Returns a new instance of DataSet.



60
61
62
# File 'lib/simple_statistics/data_set.rb', line 60

def initialize
  @datas = {}
end

Instance Attribute Details

#datasObject (readonly)

Returns the value of attribute datas.



78
79
80
# File 'lib/simple_statistics/data_set.rb', line 78

def datas
  @datas
end

Instance Method Details

#[](key) ⇒ Object



80
81
82
# File 'lib/simple_statistics/data_set.rb', line 80

def [](key)
  @datas[key.to_sym] ||= Data.new
end

#add_data(key) ⇒ Object



74
75
76
# File 'lib/simple_statistics/data_set.rb', line 74

def add_data(key)
  self[key]
end

#tick(key) ⇒ Object



68
69
70
71
72
# File 'lib/simple_statistics/data_set.rb', line 68

def tick(key)
  @datas.each do |k, data|
    data.tick(key)
  end
end

#where(probe) ⇒ Object



64
65
66
# File 'lib/simple_statistics/data_set.rb', line 64

def where(probe)
  DataFinder.new(probe, self)
end