Class: Rasta::Fixture::BaseFixture::Metrics

Inherits:
Object
  • Object
show all
Defined in:
lib/rasta/fixture/base_fixture.rb

Overview

Store metrics as the fixture is running

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMetrics

Returns a new instance of Metrics.



112
113
114
115
# File 'lib/rasta/fixture/base_fixture.rb', line 112

def initialize
  reset_page_counts
  reset_record_counts
end

Instance Attribute Details

#attribute_countObject

Returns the value of attribute attribute_count.



111
112
113
# File 'lib/rasta/fixture/base_fixture.rb', line 111

def attribute_count
  @attribute_count
end

#method_countObject

Returns the value of attribute method_count.



111
112
113
# File 'lib/rasta/fixture/base_fixture.rb', line 111

def method_count
  @method_count
end

#record_countObject

Returns the value of attribute record_count.



111
112
113
# File 'lib/rasta/fixture/base_fixture.rb', line 111

def record_count
  @record_count
end

Instance Method Details

#inc(attribute_name) ⇒ Object



125
126
127
# File 'lib/rasta/fixture/base_fixture.rb', line 125

def inc(attribute_name)
   eval("@#{attribute_name.to_s} += 1")
end

#reset_page_countsObject

Counts tracked on a worksheet scope



117
118
119
# File 'lib/rasta/fixture/base_fixture.rb', line 117

def reset_page_counts
  @record_count = 0
end

#reset_record_countsObject

Counts tracked on a record scope



121
122
123
124
# File 'lib/rasta/fixture/base_fixture.rb', line 121

def reset_record_counts
  @attribute_count = 0
  @method_count = 0
end