Class: Arrow::Column
Instance Attribute Summary collapse
-
#container ⇒ Object
readonly
Returns the value of attribute container.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#field ⇒ Object
readonly
Returns the value of attribute field.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #[](i) ⇒ Object
- #data_type ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(container, index) ⇒ Column
constructor
A new instance of Column.
- #n_nulls ⇒ Object
- #n_rows ⇒ Object (also: #size, #length)
- #name ⇒ Object
- #null?(i) ⇒ Boolean
- #reverse_each(&block) ⇒ Object
- #valid?(i) ⇒ Boolean
Constructor Details
#initialize(container, index) ⇒ Column
Returns a new instance of Column.
25 26 27 28 29 30 |
# File 'lib/arrow/column.rb', line 25 def initialize(container, index) @container = container @index = index @field = @container.schema[@index] @data = @container.get_column_data(@index) end |
Instance Attribute Details
#container ⇒ Object (readonly)
Returns the value of attribute container.
22 23 24 |
# File 'lib/arrow/column.rb', line 22 def container @container end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
24 25 26 |
# File 'lib/arrow/column.rb', line 24 def data @data end |
#field ⇒ Object (readonly)
Returns the value of attribute field.
23 24 25 |
# File 'lib/arrow/column.rb', line 23 def field @field end |
Instance Method Details
#==(other) ⇒ Object
70 71 72 73 74 |
# File 'lib/arrow/column.rb', line 70 def ==(other) other.is_a?(self.class) and @field == other.field and @data == other.data end |
#[](i) ⇒ Object
48 49 50 |
# File 'lib/arrow/column.rb', line 48 def [](i) @data[i] end |
#data_type ⇒ Object
36 37 38 |
# File 'lib/arrow/column.rb', line 36 def data_type @field.data_type end |
#each(&block) ⇒ Object
52 53 54 |
# File 'lib/arrow/column.rb', line 52 def each(&block) @data.each(&block) end |
#n_nulls ⇒ Object
66 67 68 |
# File 'lib/arrow/column.rb', line 66 def n_nulls @data.n_nulls end |
#n_rows ⇒ Object Also known as: size, length
60 61 62 |
# File 'lib/arrow/column.rb', line 60 def n_rows @data.n_rows end |
#name ⇒ Object
32 33 34 |
# File 'lib/arrow/column.rb', line 32 def name @field.name end |
#null?(i) ⇒ Boolean
40 41 42 |
# File 'lib/arrow/column.rb', line 40 def null?(i) @data.null?(i) end |
#reverse_each(&block) ⇒ Object
56 57 58 |
# File 'lib/arrow/column.rb', line 56 def reverse_each(&block) @data.reverse_each(&block) end |
#valid?(i) ⇒ Boolean
44 45 46 |
# File 'lib/arrow/column.rb', line 44 def valid?(i) @data.valid?(i) end |