Results for: "tally"

Returns true if stat is readable by the real user id of this process.

File.stat("testfile").readable_real?   #=> true

If stat is writable by others, returns an integer representing the file permission bits of stat. Returns nil otherwise. The meaning of the bits is platform dependent; on Unix systems, see stat(2).

m = File.stat("/tmp").world_writable?         #=> 511
sprintf("%o", m)                              #=> "777"

Make an internal copy of the source buffer. Updates to the copy will not affect the source buffer.

source = IO::Buffer.for("Hello World")
# =>
# #<IO::Buffer 0x00007fd598466830+11 EXTERNAL READONLY SLICE>
# 0x00000000  48 65 6c 6c 6f 20 57 6f 72 6c 64                Hello World
buffer = source.dup
# =>
# #<IO::Buffer 0x0000558cbec03320+11 INTERNAL>
# 0x00000000  48 65 6c 6c 6f 20 57 6f 72 6c 64                Hello World

Read from buffer a value of type at offset. buffer_type should be one of symbols:

A buffer type refers specifically to the type of binary buffer that is stored in the buffer. For example, a :u32 buffer type is a 32-bit unsigned integer in little-endian format.

string = [1.5].pack('f')
# => "\x00\x00\xC0?"
IO::Buffer.for(string).get_value(:f32, 0)
# => 1.5

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

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]

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]

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

The start offset of the node in the source. This method is effectively a delegate method to the location object.

Search took: 5ms  ·  Total Results: 1835