Class: Parqueteur::Column

Inherits:
Object
  • Object
show all
Defined in:
lib/parqueteur/column.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, type, options = {}, &block) ⇒ Column

Returns a new instance of Column.



7
8
9
10
11
# File 'lib/parqueteur/column.rb', line 7

def initialize(name, type, options = {}, &block)
  @name = name.to_s
  @type = Parqueteur::TypeResolver.resolve(type, options, &block)
  @options = options
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/parqueteur/column.rb', line 5

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/parqueteur/column.rb', line 5

def options
  @options
end

#typeObject (readonly)

Returns the value of attribute type.



5
6
7
# File 'lib/parqueteur/column.rb', line 5

def type
  @type
end

Instance Method Details

#arrow_typeObject



13
14
15
# File 'lib/parqueteur/column.rb', line 13

def arrow_type
  @type.arrow_type
end

#to_arrow_fieldObject



17
18
19
# File 'lib/parqueteur/column.rb', line 17

def to_arrow_field
  Arrow::Field.new(name, arrow_type)
end