Class: Column

Inherits:
Object
  • Object
show all
Includes:
FromHash
Defined in:
lib/dataload/loader.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#blkObject

Returns the value of attribute blk.



86
87
88
# File 'lib/dataload/loader.rb', line 86

def blk
  @blk
end

#target_nameObject

Returns the value of attribute target_name.



86
87
88
# File 'lib/dataload/loader.rb', line 86

def target_name
  @target_name
end

Instance Method Details

#target_value(row) ⇒ Object



87
88
89
90
91
92
93
# File 'lib/dataload/loader.rb', line 87

def target_value(row)
  if blk.arity == 1
    blk.call(row)
  else
    row.instance_eval(&blk)
  end
end