Method: DataShift::MethodBinding#initialize
- Defined in:
- lib/datashift/inbound_data/method_binding.rb
#initialize(name, idx, model_method) ⇒ MethodBinding
Store the raw (client supplied) name against the active record klass(model). Operator is the associated method call on klass, i.e client supplies name ‘Price’ in a spreadsheet, but true operator to call on klass is price
type determines the style of operator call; simple assignment, an association or a method call
col_types can typically be derived from klass.columns - set of ActiveRecord::ConnectionAdapters::Column
38 39 40 41 42 43 44 |
# File 'lib/datashift/inbound_data/method_binding.rb', line 38 def initialize(name, idx, model_method) @inbound_column = InboundData::Column.new(name, idx) @model_method = model_method @valid = (name && model_method) ? true : false end |