Class: Reporter::TimeOptimizedResultRow

Inherits:
ResultRow
  • Object
show all
Defined in:
lib/reporter/time_optimized_result_row.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data_set, scope_serialization, scope, period) ⇒ TimeOptimizedResultRow

Returns a new instance of TimeOptimizedResultRow.



3
4
5
6
7
8
# File 'lib/reporter/time_optimized_result_row.rb', line 3

def initialize(data_set, scope_serialization, scope, period)
	super data_set, scope_serialization
	@scope = scope
	@period = period
	@active_scope = nil
end

Instance Attribute Details

#current_iterationObject

Returns the value of attribute current_iteration.



10
11
12
# File 'lib/reporter/time_optimized_result_row.rb', line 10

def current_iteration
  @current_iteration
end

Instance Method Details

#[](field) ⇒ Object



16
17
18
19
20
21
# File 'lib/reporter/time_optimized_result_row.rb', line 16

def [] field
	field_cache[field] ||= {}
	preload_time_period_values_for field unless field_cache[field].has_key? current_iteration[:type]
	field_cache[field][current_iteration[:type]] ||= {}
	field_cache[field][current_iteration[:type]][current_iteration[:period]] ||= load_field_values(field)[field]
end

#scope=(scope) ⇒ Object



12
13
14
# File 'lib/reporter/time_optimized_result_row.rb', line 12

def scope= scope
	@scope_serialization = scope
end