Class: Rseed::Adapter

Inherits:
Object
  • Object
show all
Defined in:
lib/rseed/adapter.rb

Direct Known Subclasses

CsvAdapter, HashAdapter

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#converterObject

Returns the value of attribute converter.



6
7
8
# File 'lib/rseed/adapter.rb', line 6

def converter
  @converter
end

#errorObject (readonly)

Returns the value of attribute error.



5
6
7
# File 'lib/rseed/adapter.rb', line 5

def error
  @error
end

#loggerObject



8
9
10
# File 'lib/rseed/adapter.rb', line 8

def logger
  @logger.nil? ? Rseed.logger : @logger
end

#optionsObject



12
13
14
# File 'lib/rseed/adapter.rb', line 12

def options
  @options.nil? ? {} : @options
end

Instance Method Details

#converter_attributesObject



16
17
18
19
# File 'lib/rseed/adapter.rb', line 16

def converter_attributes
  return [] unless converter
  converter.class.converter_attributes
end

#mandatory_attributesObject



21
22
23
24
# File 'lib/rseed/adapter.rb', line 21

def mandatory_attributes
  return [] unless converter
  converter.class.mandatory_attributes
end

#preprocessObject

Dummy process that should be overwritten by other adapters



27
28
29
# File 'lib/rseed/adapter.rb', line 27

def preprocess
  return true
end

#process {|values, meta| ... } ⇒ Object

Yields:

  • (values, meta)


31
32
33
34
35
# File 'lib/rseed/adapter.rb', line 31

def process &block
  values = {}
  meta = {}
  yield values, meta
end