Class: DataShift::InboundData::Column
- Inherits:
-
Object
- Object
- DataShift::InboundData::Column
- Defined in:
- lib/datashift/inbound_data/column.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#header ⇒ Object
Returns the value of attribute header.
-
#index ⇒ Object
Returns the value of attribute index.
-
#lookup_list ⇒ Object
(also: #lookups)
Returns the value of attribute lookup_list.
Instance Method Summary collapse
- #add_lookup(klass, field, where_value) ⇒ Object
- #find_by_operator ⇒ Object
- #find_by_value ⇒ Object
-
#initialize(source, index = -1)) ⇒ Column
constructor
A new instance of Column.
Constructor Details
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
15 16 17 |
# File 'lib/datashift/inbound_data/column.rb', line 15 def data @data end |
#header ⇒ Object
Returns the value of attribute header.
15 16 17 |
# File 'lib/datashift/inbound_data/column.rb', line 15 def header @header end |
#index ⇒ Object
Returns the value of attribute index.
15 16 17 |
# File 'lib/datashift/inbound_data/column.rb', line 15 def index @index end |
#lookup_list ⇒ Object Also known as: lookups
Returns the value of attribute lookup_list.
15 16 17 |
# File 'lib/datashift/inbound_data/column.rb', line 15 def lookup_list @lookup_list end |
Instance Method Details
#add_lookup(klass, field, where_value) ⇒ Object
30 31 32 |
# File 'lib/datashift/inbound_data/column.rb', line 30 def add_lookup( klass, field, where_value ) @lookup_list.unshift( LookupSupport.new(klass, field, where_value) ) end |
#find_by_operator ⇒ Object
34 35 36 |
# File 'lib/datashift/inbound_data/column.rb', line 34 def find_by_operator lookup_list.first ? lookup_list.first.field : '' end |
#find_by_value ⇒ Object
38 39 40 |
# File 'lib/datashift/inbound_data/column.rb', line 38 def find_by_value lookup_list.first ? lookup_list.first.value : '' end |