Class: DataShift::InboundData::LookupSupport

Inherits:
Object
  • Object
show all
Defined in:
lib/datashift/inbound_data/lookup_support.rb

Overview

Klass.where( @field => @where_value)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass, in_name, where_value) ⇒ LookupSupport

Returns a new instance of LookupSupport.



20
21
22
23
24
# File 'lib/datashift/inbound_data/lookup_support.rb', line 20

def initialize(klass, in_name, where_value)
  @klass = klass
  @field = in_name
  @where_value = where_value
end

Instance Attribute Details

#fieldObject (readonly)

Returns the value of attribute field.



18
19
20
# File 'lib/datashift/inbound_data/lookup_support.rb', line 18

def field
  @field
end

#klassObject (readonly)

Returns the value of attribute klass.



18
19
20
# File 'lib/datashift/inbound_data/lookup_support.rb', line 18

def klass
  @klass
end

#where_valueObject (readonly)

Returns the value of attribute where_value.



18
19
20
# File 'lib/datashift/inbound_data/lookup_support.rb', line 18

def where_value
  @where_value
end

Instance Method Details

#findObject



26
27
28
# File 'lib/datashift/inbound_data/lookup_support.rb', line 26

def find
  klass.where( field => where_value )
end