Class: Pal::Operation::Projection

Inherits:
Object
  • Object
show all
Includes:
Log
Defined in:
lib/pal/operation/projection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Log

#log_debug, #log_error, #log_info, #log_warn

Constructor Details

#initialize(type, property) ⇒ Projection

Returns a new instance of Projection.

Parameters:

  • type (String)
  • property (String)


18
19
20
21
# File 'lib/pal/operation/projection.rb', line 18

def initialize(type, property)
  @type = type
  @property = property
end

Instance Attribute Details

#propertyString (readonly)

Returns:

  • (String)


14
15
16
# File 'lib/pal/operation/projection.rb', line 14

def property
  @property
end

#typeString (readonly)

Returns:

  • (String)


11
12
13
# File 'lib/pal/operation/projection.rb', line 11

def type
  @type
end

Instance Method Details

#process(group_by_rules, groups, column_headers) ⇒ Array

Returns rows, column_headers.

Parameters:

  • group_by_rules (Array<String>)

    # export columns

  • groups (Hash)
  • column_headers (Hash)

Returns:

  • (Array)

    rows, column_headers



27
28
29
30
# File 'lib/pal/operation/projection.rb', line 27

def process(group_by_rules, groups, column_headers)
  log_info("Calling down to projection impl [#{type}]")
  _process_impl(group_by_rules, groups, column_headers)
end

#processable?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/pal/operation/projection.rb', line 33

def processable?
  !(@type.nil? || @property.nil?)
end