Class: Pal::Operation::Actions
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from Log
#log_debug, #log_error, #log_info, #log_warn
#attributes=, #from_hash, #from_json
Instance Attribute Details
#group_by ⇒ Array<String>
13
14
15
|
# File 'lib/pal/operation/actions.rb', line 13
def group_by
@group_by
end
|
19
20
21
|
# File 'lib/pal/operation/actions.rb', line 19
def projection
@projection
end
|
#sort_by ⇒ String
16
17
18
|
# File 'lib/pal/operation/actions.rb', line 16
def sort_by
@sort_by
end
|
Instance Method Details
#process(rows, column_headers) ⇒ Array
Returns rows, column_headers.
34
35
36
37
38
39
40
41
42
43
44
|
# File 'lib/pal/operation/actions.rb', line 34
def process(rows, column_headers)
grouped = perform_group_by(rows, column_headers)
return [rows, column_headers] unless @projection&.processable?
log_info("Performing projection by [#{@projection.type}].")
rows, column_headers = perform_projection(grouped, column_headers)
rows, column_headers = perform_sort_by(rows, column_headers)
[rows, column_headers]
end
|
#processable? ⇒ Boolean
26
27
28
29
|
# File 'lib/pal/operation/actions.rb', line 26
def processable?
!@group_by.nil?
end
|