ptr.to_str => string ptr.to_str(len) => string
Returns the pointer contents as a string.
When called with no arguments, this method will return the contents with the length of this pointer’s size
.
When called with len
, a string of len
bytes will be returned.
See to_s
Same as IO
.
Returns serialized iseq binary format data as a String
object. A corresponding iseq object is created by RubyVM::InstructionSequence.load_from_binary()
method.
String
extra_data will be saved with binary data. You can access this data with RubyVM::InstructionSequence.load_from_binary_extra_data(binary)
.
Note that the translated binary data is not portable. You can not move this binary data to another machine. You can not use the binary data which is created by another version/another architecture of Ruby.
Returns the row as a CSV String
. Headers are not included:
source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n" table = CSV.parse(source, headers: true) row = table[0] row.to_csv # => "foo,0\n"
Returns the table as CSV string. See Options for Generating.
Defaults option write_headers
to true
:
source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n" table = CSV.parse(source, headers: true) table.to_csv # => "Name,Value\nfoo,0\nbar,1\nbaz,2\n"
Omits the headers if option write_headers
is given as false
(see {Option write_headers
}):
table.to_csv(write_headers: false) # => "foo,0\nbar,1\nbaz,2\n"
Limit rows if option limit
is given like 2
:
table.to_csv(limit: 2) # => "Name,Value\nfoo,0\nbar,1\n"
Convert an object reference id to an object.
This implementation looks up the reference id in the local object space and returns the object it refers to.
Convert an object into a reference id.
This implementation returns the object’s __id__ in the local object space.
Convert a dRuby reference to the local object it refers to.
Convert a local object to a dRuby reference.
Convert an object reference id to an object.
This implementation looks up the reference id in the local object space and returns the object it refers to.
Convert an object into a reference id.
This implementation returns the object’s __id__ in the local object space.
Turns this IPv4
address into a Resolv::DNS::Name
.
Turns this IPv6
address into a Resolv::DNS::Name
.
Full path of the target library file. If the file is not in this gem, return nil.
Return a Gem::Specification
from this gem