Class: Optimus::Transformers::RowFilter

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/transformers/row_filter.rb

Overview

Implements a row-wise filter for optimus data. Right now it requires a proc; I’ll do something better with a little DSL later.

Instance Method Summary collapse

Constructor Details

#initialize(data, filter) ⇒ RowFilter

Returns a new instance of RowFilter.



17
18
19
20
21
# File 'lib/transformers/row_filter.rb', line 17

def initialize(data, filter)
  @data = data
  @filter = filter
  @computed = nil
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



27
28
29
# File 'lib/transformers/row_filter.rb', line 27

def method_missing(method, *args, &block)
  computed.send method, *args, &block
end

Instance Method Details

#to_optimus_dataObject



23
24
25
# File 'lib/transformers/row_filter.rb', line 23

def to_optimus_data
  computed
end