Class: Rasta::Fixture::BaseFixture::Metrics
- Inherits:
-
Object
- Object
- Rasta::Fixture::BaseFixture::Metrics
- Defined in:
- lib/rasta/fixture/base_fixture.rb
Overview
Store metrics as the fixture is running
Instance Attribute Summary collapse
-
#attribute_count ⇒ Object
Returns the value of attribute attribute_count.
-
#method_count ⇒ Object
Returns the value of attribute method_count.
-
#record_count ⇒ Object
Returns the value of attribute record_count.
Instance Method Summary collapse
- #inc(attribute_name) ⇒ Object
-
#initialize ⇒ Metrics
constructor
A new instance of Metrics.
-
#reset_page_counts ⇒ Object
Counts tracked on a worksheet scope.
-
#reset_record_counts ⇒ Object
Counts tracked on a record scope.
Constructor Details
#initialize ⇒ Metrics
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_count ⇒ Object
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_count ⇒ Object
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_count ⇒ Object
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_counts ⇒ Object
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_counts ⇒ Object
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 |