Results for: "tally"

Similar to get_value, except that it can handle multiple buffer types and returns an array of values.

string = [1.5, 2.5].pack('ff')
IO::Buffer.for(string).get_values([:f32, :f32], 0)
# => [1.5, 2.5]

Write to a buffer a value of type at offset. type should be one of symbols described in get_value.

buffer = IO::Buffer.new(8)
# =>
# #<IO::Buffer 0x0000555f5c9a2d50+8 INTERNAL>
# 0x00000000  00 00 00 00 00 00 00 00

buffer.set_value(:U8, 1, 111)
# => 1

buffer
# =>
# #<IO::Buffer 0x0000555f5c9a2d50+8 INTERNAL>
# 0x00000000  00 6f 00 00 00 00 00 00                         .o......

Note that if the type is integer and value is Float, the implicit truncation is performed:

buffer = IO::Buffer.new(8)
buffer.set_value(:U32, 0, 2.5)

buffer
# =>
# #<IO::Buffer 0x0000555f5c9a2d50+8 INTERNAL>
# 0x00000000  00 00 00 02 00 00 00 00
#                      ^^ the same as if we'd pass just integer 2

Write values of buffer_types at offset to the buffer. buffer_types should be an array of symbols as described in get_value. values should be an array of values to write.

buffer = IO::Buffer.new(8)
buffer.set_values([:U8, :U16], 0, [1, 2])
buffer
# =>
# #<IO::Buffer 0x696f717561746978+8 INTERNAL>
# 0x00000000  01 00 02 00 00 00 00 00                         ........
No documentation available
No documentation available
No documentation available

Calls superclass method.

No documentation available

If the access mode is :row or :col_or_row, and each argument is either an Integer or a Range, returns rows. Otherwise, returns columns data.

In either case, the returned values are in the order specified by the arguments. Arguments may be repeated.


Returns rows as an Array of CSV::Row objects.

No argument:

source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n"
table = CSV.parse(source, headers: true)
table.values_at # => []

One index:

values = table.values_at(0)
values # => [#<CSV::Row "Name":"foo" "Value":"0">]

Two indexes:

values = table.values_at(2, 0)
values # => [#<CSV::Row "Name":"baz" "Value":"2">, #<CSV::Row "Name":"foo" "Value":"0">]

One Range:

values = table.values_at(1..2)
values # => [#<CSV::Row "Name":"bar" "Value":"1">, #<CSV::Row "Name":"baz" "Value":"2">]

Ranges and indexes:

values = table.values_at(0..1, 1..2, 0, 2)
pp values

Output:

[#<CSV::Row "Name":"foo" "Value":"0">,
 #<CSV::Row "Name":"bar" "Value":"1">,
 #<CSV::Row "Name":"bar" "Value":"1">,
 #<CSV::Row "Name":"baz" "Value":"2">,
 #<CSV::Row "Name":"foo" "Value":"0">,
 #<CSV::Row "Name":"baz" "Value":"2">]

Returns columns data as row Arrays, each consisting of the specified columns data for that row:

values = table.values_at('Name')
values # => [["foo"], ["bar"], ["baz"]]
values = table.values_at('Value', 'Name')
values # => [["0", "foo"], ["1", "bar"], ["2", "baz"]]
No documentation available
No documentation available

def comment_targets: () -> Array[Node | Location]

def comment_targets: () -> Array[Node | Location]

def comment_targets: () -> Array[Node | Location]

def comment_targets: () -> Array[Node | Location]

def comment_targets: () -> Array[Node | Location]

def comment_targets: () -> Array[Node | Location]

def contains_splat?: () -> bool

def comment_targets: () -> Array[Node | Location]

def comment_targets: () -> Array[Node | Location]

def comment_targets: () -> Array[Node | Location]

def comment_targets: () -> Array[Node | Location]

def comment_targets: () -> Array[Node | Location]

def comment_targets: () -> Array[Node | Location]

def comment_targets: () -> Array[Node | Location]

Search took: 4ms  ·  Total Results: 1651