This is a Ruby tree! It shows every object from the Ruby Programming Language in a tree format.

write

        # IO.write

(from ruby core)
---
    IO.write(name, string [, offset])           -> integer
    IO.write(name, string [, offset] [, opt])   -> integer
    File.write(name, string [, offset])         -> integer
    File.write(name, string [, offset] [, opt]) -> integer

---

Opens the file, optionally seeks to the given *offset*, writes *string*,
then returns the length written.  #write ensures the file is closed
before returning.  If *offset* is not given in write mode, the file is
truncated.  Otherwise, it is not truncated.

If `name` starts with a pipe character (`"|"`) and the receiver is the
IO class, a subprocess is created in the same way as Kernel#open, and
its output is returned. Consider to use File.write to disable the
behavior of subprocess invocation.

    File.write("testfile", "0123456789", 20)  #=> 10
    # File could contain:  "This is line one\nThi0123456789two\nThis is line three\nAnd so on...\n"
    File.write("testfile", "0123456789")      #=> 10
    # File would now read: "0123456789"
    IO.write("|tr a-z A-Z", "abc")            #=> 3
    # Prints "ABC" to the standard output

If the last argument is a hash, it specifies options for the internal
open().  It accepts the following keys:

:encoding
:   string or encoding

    Specifies the encoding of the read string. See Encoding.aliases for
    possible encodings.

:mode
:   string or integer

    Specifies the *mode* argument for open().  It must start with "w",
    "a", or "r+", otherwise it will cause an error. See IO.new for the
    list of possible modes.

:perm
:   integer

    Specifies the *perm* argument for open().

:open_args
:   array

    Specifies arguments for open() as an array. This key can not be used
    in combination with other keys.


See also IO.read for details about `name` and open_args.


(from ruby core)
---
    write(*objects) -> integer

---

Writes each of the given `objects` to `self`, which must be opened for
writing (see [Modes](#class-IO-label-Modes)); returns the total number
bytes written; each of `objects` that is not a string is converted via
method `to_s`:

    $stdout.write('Hello', ', ', 'World!', "\n") # => 14
    $stdout.write('foo', :bar, 2, "\n")          # => 8

Output:

    Hello, World!
    foobar2



      

This is MURDOC! A Ruby documentation browser inspired by Smalltalk-80. It allows you to learn about Ruby by browsing through its class hierarchies, and see any of its methods.