(function() { fancy.fdoc({title:"Fancy Documentation", objects:{}, date:"Wed Oct 05 23:06:04 -0700 2011", classes:{"File":{ancestors:["File", "Enumerable", "IO", "IOMixin", "Object", "Unmarshalable", "File Constants", "Enumerable", "Object", "Kernel"], instance_methods:{"write:":{file:"lib/rbx/file.fy", lines:[172, 172], doc:"
Writes a given String
to a File
.
Writes a newline character to the File
.
Writes a given argument as a String followed by a newline into the\nFile.
\n\n\n\n", arg:["x"]}, "println:":{file:"lib/file.fy", lines:[53, 53], doc:"Writes a given argument as a String followed by a newline into the\nFile.
\n\n\n\n", arg:["x"]}, "print:":{file:"lib/rbx/file.fy", lines:[172, 172], doc:"Writes a given String
to a File
.
Returns the File
access modes Array
.
Indicates, if a File
is opened.
Sets the File
access modes Array
.
Closes an opened File
.
Indicates, if a File
is a Directory
.
Instances of File represent files in the filesystem of the operating\nsystem on which Fancy is running.
\n\n\n\n", methods:{"delete:":{file:"lib/rbx/file.fy", lines:[110, 110], doc:"Deletes a File
with a given filename
.
Opens a File with a given filename
, a modes_arr
(Array
) and a block
.
E.g. to open a File with read access and read all lines and print them to STDOUT:
\n\nFile open: \"foo.txt\" modes: ['read] with: |f| {
\n\n { f eof? } while_false: {\n f readln println\n }\n
\n\n}
\n\n \n\n", arg:["filename", "modes_arr", "block"]}, "touch:":{file:"lib/file.fy", lines:[40, 40], doc:"Creates a new empty file with the given filename
, if it doesn't already exist.
Indicates if the File
with the given filename
exists.
Renames a File
on the filesystem.
Returns the appropriate String
representation of the modes_arr
.
Indicates, if a given path
refers to a Directory
.
Similar to open:modes:with: but takes no Block
argument to be\ncalled with the File
instance.\nReturns the opened File
instead and expects the caller to close
it manually.
Reads all the contens (in ASCII mode) of a given file and returns\nthem as an Array of lines being read.
\n\n\n\n", arg:["filename"]}}}, "Set":{ancestors:["Set", "FancyEnumerable", "Object", "Object", "Kernel"], instance_methods:{":-":{file:"lib/set.fy", lines:[157, 157], doc:"\n\n \n\n", arg:["other"]}, "initialize:":{file:"lib/set.fy", lines:[15, 15], doc:"Initialize a new Set with a given collection of values.
\n\n \n\n", arg:["values"]}, ":initialize":{file:"lib/set.fy", lines:[26, 26], doc:"Initialize a new empty Set.
\n\n\n\n", arg:[]}, ":size":{file:"lib/set.fy", lines:[42, 42], doc:"\n\n \n\n", arg:[]}, "remove:":{file:"lib/set.fy", lines:[139, 139], doc:"Removes a given object from a Set, if available.
\n\n \n\n", arg:["obj"]}, ":inspect":{file:"lib/set.fy", lines:[129, 129], doc:"Returns a detailed String
representation of a Set.
Insert a value into the Set.
\n\n \n\n", arg:["value"]}, ":values":{file:"lib/set.fy", lines:[34, 34], doc:"\n\n \n\n", arg:[]}, ":&":{file:"lib/set.fy", lines:[170, 170], doc:"\n\n \n\n", arg:["other"]}, ":+":{file:"lib/set.fy", lines:[148, 148], doc:"\n\n \n\n", arg:["other"]}, ":==":{file:"lib/set.fy", lines:[68, 68], doc:"Indicates, if two Sets are equal.
\n\n \n\n", arg:["other"]}, "each:":{file:"lib/set.fy", lines:[112, 112], doc:"Calls a given Block for each element of the Set.
\n\n \n\n", arg:["block"]}, "includes?:":{file:"lib/set.fy", lines:[101, 101], doc:"Indicates, if the Set includes a given value.
\n\n \n\n", arg:["value"]}, ":empty?":{file:"lib/set.fy", lines:[52, 52], doc:"Indicates, if a Set is empty.
\n\n \n\n", arg:[]}, ":to_s":{file:"lib/set.fy", lines:[121, 121], doc:"Returns a String
representation of a Set.
A simple Set data structure class.
\n\n\n\n", methods:{":[]":{file:"lib/set.fy", lines:[78, 78], doc:"Initialize a new Set with a given collection of values.
\n\n \n\n", arg:["values"]}}}, "Struct":{ancestors:["Struct", "Enumerable", "Object", "Kernel"], instance_methods:{}, doc:"Structs are light-weight classes with predefined read-writable slots.
\n\n\n\n", methods:{"new:":{file:"lib/struct.fy", lines:[14, 14], doc:"Creates a new Struct class with the given slots.
\n\n \n\n", arg:["slots"]}}}, "Fancy Package":{ancestors:["Fancy Package", "Object", "Kernel"], instance_methods:{}, doc:"The Fancy Package System.
\n\nThis class is used for installing and uninstalling fancy packages on\nthe system.
\n\nExample:
\n\n $ fancy install bakkdoor/mongo.fy\n
\n\nWill install the mongo.fy package from http://github.com/bakkdoor/mongo.fy\nin the latest released version or get the current HEAD (master\nbranch) revision.
\n\nYou can then load the package in your source file via
\n\n require: \"mongo.fy\"\n
\n\n\n\n", methods:{":add_to_loadpath":{file:"lib/package.fy", lines:[89, 89], doc:"Adds the Fancy Package install dir to the loadpath so you can\neasily require:
packages into your code.
Uninstalls a package with a given name (if installed).
\n\n \n\n", arg:["package_name"]}, ":list_packages":{file:"lib/package.fy", lines:[60, 60], doc:"Lists (prints) all installed packages on this system.
\n\n\n\n", arg:[]}, ":package_list_file":{file:"lib/package.fy", lines:[80, 80], doc:"\n\n \n\n", arg:[]}, ":root_dir":{file:"lib/package.fy", lines:[73, 73], doc:"\n\n \n\n", arg:[]}, "install:":{file:"lib/package.fy", lines:[42, 42], doc:"Installs a package with a given name.\nExpects package_name to be a string in the form of:\n user/repo\nWhich would get the package code from github.com/user/repo
\n\n \n\n", arg:["package_name"]}}}, "RespondsToProxy":{ancestors:["RespondsToProxy", "BasicObject", "Object", "Kernel"], instance_methods:{"initialize:":{file:"lib/proxy.fy", lines:[48, 48], doc:"Initializes a new RespondsToProxy for target
.
Forwards all incoming message to self
to @target
\nonly if @target
responds to them.
A RespondsToProxy is a Proxy that forwards any message sent to it to it's target
instance variable\nonly if it responds to that message. Any messages that target
doesn't respond to simply won't be sent\nand nil
will be returned.
Joins all elements with the empty String
.
[\"hello\", \"world\", \"!\"] join # => \"hello,world!\"\n
\n\n \n\n", arg:[]}, "index:":{file:"lib/rbx/array.fy", lines:[84, 84], doc:"Returns the index of an item (or nil, if it isn't in the Array
).
Like Array
remove:
, but taking a condition Block
.\nRemoves all elements that meet the given condition Block
.
Same as #select:, just gets also called with an additional argument\nfor each element's index value.
\n\n\n\n", arg:["block"]}, ":first":{file:"lib/array.fy", lines:[94, 94], doc:"\n\n \n\n", arg:[]}, "reverse_each:":{file:"lib/array.fy", lines:[157, 157], doc:"Example:
\n\n [1,2,3] reverse_each: <code data-lang=\"fancy\">{print</code>}\n # prints: 321\n
\n\n \n\n", arg:["block"]}, ":to_a":{file:"lib/array.fy", lines:[367, 367], doc:"\n\n \n\n", arg:[]}, "prepend:":{file:"lib/array.fy", lines:[66, 66], doc:"Prepends another Array
to this one.
Example:
\n\n a = [1,2,3]\n a prepend: [4,5,6]\n a # => [4,5,6,1,2,3]\n
\n\n \n\n\n\n", arg:["arr"]}, ":compact!":{file:"lib/array.fy", lines:[296, 296], doc:"Removes all nil-value elements in place.
\n\n \n\n\n\n", arg:[]}, "indices_of:":{file:"lib/array.fy", lines:[414, 414], doc:"Returns an Array of all indices of this item. Empty Array if item does not occur.
\n\n [1, 'foo, 2, 'foo] indices_of: 'foo # => [1, 3]\n
\n\n \n\n", arg:["item"]}, "at:":{file:"lib/rbx/array.fy", lines:[58, 58], doc:"Returns the element in the Array
at a given index.
Calls a given Block
with each element in the Array
.
Joins all elements in the Array with a given String
.\n [1,2,3] join: \", \\\342\200\235 # => \\\342\200\2351, 2, 3\"
Removes an element at a given index.\nIf given an Array of indices, removes all the elements with these indices.\nReturns the deleted object if an index was given, the last deleted object for an Array given.
\n\n\n\n", arg:["index"]}, "select!:":{file:"lib/array.fy", lines:[276, 276], doc:"Removes all elements in place, that don't meet the condition.
\n\n \n\n", arg:["condition"]}, "values_at:":{file:"lib/array.fy", lines:[237, 237], doc:"Returns new Array
with elements at given indices.
Returns an Array
of all the indices of an Array
.
[1,2,3] indices # => [0,1,2]\n
\n\n \n\n", arg:[]}, "at:put:":{file:"lib/rbx/array.fy", lines:[72, 72], doc:"Inserts a given object at a given index (position) in the Array.
\n\n \n\n\n\n", arg:["idx", "obj"]}, ":rest":{file:"lib/array.fy", lines:[124, 124], doc:"Returns all elements except the first one as a new Array
.
Prints each element on a seperate line.
\n\n\n\n", arg:[]}, "from:to:":{file:"lib/array.fy", lines:[434, 434], doc:"Returns sub-array starting at from: and going to to:
\n\n \n\n", arg:["from", "to"]}, "append:":{file:"lib/array.fy", lines:[47, 47], doc:"Appends another Array
onto this one.
Example:
\n\n a = [1,2,3]\n a append: [3,4,5]\n a # => [1,2,3,3,4,5]\n
\n\n \n\n\n\n", arg:["arr"]}, "find:":{file:"lib/array.fy", lines:[211, 211], doc:"Returns the item, if it's in the Array or nil (if not found).
\n\n \n\n", arg:["item"]}, "find_by:":{file:"lib/array.fy", lines:[226, 226], doc:"Like find: but takes a block that gets called with each element to find it.
\n\n \n\n", arg:["block"]}, "remove:":{file:"lib/array.fy", lines:[308, 308], doc:"Removes all occurances of obj in the Array.
\n\n \n\n", arg:["obj"]}, ":*":{file:"lib/array.fy", lines:[376, 376], doc:"Returns a new Array
that contains the elements of self num times\nin a row.
Clones (shallow copy) the Array
.
Same as Array#reject: but doing so in-place (destructive).
\n\n\n\n", arg:["block"]}, ":inspect":{file:"lib/array.fy", lines:[353, 353], doc:"Returns a pretty-printed String
representation of self
.\nExample:
[1, 'foo, \"bar\", 42] inspect # => \"[1, 'foo, \\\"bar\\\", 42]\"\n
\n\n \n\n", arg:[]}, "[]:":{file:"lib/rbx/array.fy", lines:[72, 72], doc:"Inserts a given object at a given index (position) in the Array.
\n\n \n\n\n\n", arg:["idx", "obj"]}, ":[]":{file:"lib/array.fy", lines:[87, 87], doc:"Given an Array
of 2 Fixnum
s, it returns the sub-array between the given indices.\nIf given a single Fixnum
, returns the element at that index.
Returns concatenation with another Array
.
[1,2,3] + [3,4,5] # => [1,2,3,3,4,5]\n
\n\n \n\n", arg:["other_arr"]}, "select:":{file:"lib/array.fy", lines:[453, 453], doc:"Returns a new Array with all the elements in self that yield a\ntrue-ish value when called with the given Block.
\n\n \n\n", arg:["block"]}, ":third":{file:"lib/array.fy", lines:[108, 108], doc:"\n\n \n\n", arg:[]}, ":>>":{file:"lib/array.fy", lines:[252, 252], doc:"Returns new Array with elements of other_arr appended to these.
\n\n \n\n", arg:["other_arr"]}, "each_with_index:":{file:"lib/array.fy", lines:[172, 172], doc:"Iterate over all elements in Array
.\nCalls a given Block
with each element and its index.
Indicates, if an Array includes a given value.
\n\n \n\n", arg:["obj"]}, ":fourth":{file:"lib/array.fy", lines:[115, 115], doc:"\n\n \n\n", arg:[]}, "last:":{file:"lib/rbx/array.fy", lines:[94, 94], doc:"Returns new Array with last n elements specified.
\n\n \n\n", arg:["count"]}, ":to_s":{file:"lib/array.fy", lines:[342, 342], doc:"Returns String
representation of Array
.
Compares two Arrays where order does not matter.
\n\n \n\n", arg:["other"]}}, doc:"Array class.\nArrays are dynamically resizable containers with a constant-time\nindex-based access to members.
\n\n\n\n", methods:{"new:":{file:"lib/array.fy", lines:[17, 17], doc:"Creates a new Array with a given size
(default value is nil
).
Matches an Array
against another object.
Creates a new Array with a given size and default-value.
\n\n\n\n", arg:["size", "default"]}}}, "Fixnum":{ancestors:["Fixnum", "Number", "Object", "ImmediateValue", "Integer", "Precision", "Numeric", "Comparable", "Object", "Kernel"], instance_methods:{}, doc:"Standard class for integer values in Fancy.
\n\n\n\n", methods:{}}, "Directory":{ancestors:["Directory", "Object", "Kernel"], instance_methods:{}, doc:"Instances of Directory
represent directories in the filesystem of\nthe operating system, in which Fancy is being run.
Deletes a directory with a given name, if it's empty.
\n\n \n\n", arg:["dirname"]}, "list:":{file:"lib/rbx/directory.fy", lines:[56, 56], doc:"Example usage:\n Directory list: \"tests/*/.fy\" # => [\"tests/file1.fy\", \"tests/more/file2.fy\"]
\n\n \n\n", arg:["pattern"]}, "create:":{file:"lib/rbx/directory.fy", lines:[15, 15], doc:"Creates a new Directory
on the filesystem, possibly throwing\nIOError Exceptions that might occur.
Indicates, if a Directory exists with a given pathname.
\n\n \n\n", arg:["dirname"]}, "create!:":{file:"lib/rbx/directory.fy", lines:[30, 30], doc:"Creates a new Directory
on the filesystem, ignoring any\nExceptions that might occur.\nBasically works like running mkdir -p
on the shell.
Forwards all incoming messages to self
to @proxy
and then @obj
.
Initializes a new ProxyReceiver with proxy
for obj
.
A ProxyReceiver is an object which proxies all message sends to it to 2 other objects.\nIt will send each message first to its proxy
instance variable and then to the obj
instance variable.
NameError exception class. Used within Rubinius.
\n\n\n\n", methods:{}}, "Range":{ancestors:["Range", "FancyEnumerable", "Object", "Enumerable", "Object", "Kernel"], instance_methods:{"each:":{file:"lib/rbx/range.fy", lines:[36, 36], doc:"Calls block
on each value in self
. Used for iterating over a Range
.
Initializes a new Range starting at start
and ending at end
.
Same as Range#inspect
\n\n\n\n", arg:[]}, ":inspect":{file:"lib/range.fy", lines:[26, 26], doc:"\n\n \n\n", arg:[]}}, doc:"Class of Range values. Are created by using Range literal syntax in Fancy.
\n\nExample:
\n\n (10..100) # Range from 10 to 100\n # the following code does the same as above:\n Range new: 10 to: 100\n
\n\n\n\n", methods:{}}, "Thread":{ancestors:["Thread", "Object", "Kernel"], instance_methods:{}, doc:"Thread class.\nDeals with parallel execution.
\n\nTODO:\n=> Still need to add more Fancy-ish wrapper methods and method\n documentation.
\n\n\n\n", methods:{"sleep:":{file:"lib/rbx/thread.fy", lines:[87, 87], doc:"Sets the Fancy process for a given amount of seconds to sleep.
\n\n\n\n", arg:["seconds"]}}}, "Fancy Package Uninstaller":{ancestors:["Fancy Package Uninstaller", "Object", "Kernel"], instance_methods:{}, doc:"Fancy
Package@ Uninstaller.
Class for large integer values in Fancy.
\n\n\n\n", methods:{}}, "MatchData":{ancestors:["MatchData", "Unmarshalable", "Object", "Kernel"], instance_methods:{"at:":{file:"lib/rbx/match_data.fy", lines:[16, 16], doc:"\n\n \n\n", arg:["idx"]}, ":to_a":{file:"lib/rbx/match_data.fy", lines:[24, 24], doc:"\n\n \n\n", arg:[]}}, doc:"MatchData instances are created when using the #=== match operator\n(e.g. by using match/case expressions).
\n\n\n\n", methods:{}}, "NilClass":{ancestors:["NilClass", "ImmediateValue", "Object", "Kernel"], instance_methods:{"if_nil:":{file:"lib/nil_class.fy", lines:[41, 41], doc:"Calls block
with self
.
Calls then_block
with self
.
Calls else_block
.
NilClass. The class of the singleton nil
value.
Regular Expression class. Used by Regexp literals in Fancy.
\n\n\n\n", methods:{}}, "Date":{ancestors:["Date", "Comparable", "Object", "Kernel"], instance_methods:{}, doc:"Date class. Used for timely stuff.
\n\n\n\n", methods:{}}, "TCPSocket":{ancestors:["TCPSocket", "IPSocket", "BasicSocket", "IO", "IOMixin", "Object", "Unmarshalable", "File Constants", "Enumerable", "Object", "Kernel"], instance_methods:{}, doc:"TCP Socket class.
\n\n\n\n", methods:{"open:port:":{file:"lib/rbx/tcp_socket.fy", lines:[17, 17], doc:"Creates and opens a new TCPSocket
on server
and port
.
If format is specified, the documentation string will be\nconverted using the corresponding formatter. This allows\nyou to extend Fancy documentation system, and produce\nhtml documents, man pages, or anything you can imagine.
\n\n\n\n", arg:["format"]}, ":docs":{doc:"An array of docstrings for the object beind documented.
\n\nWe have an array of docstrings because in Fancy, some\nthings like classes can be re-openned and the user may\nspecify new documentation for it each time. Thus we dont\nwant to loose the previous documentation but rather build\nupon it. That is, fancy supports incremental documentation.
\n\n\n\n"}, ":specs":{doc:"An array of associated Fancy specs for the object\nbeing documented.
\n\nIts a lot better to keep the associated specs in\nFancy Documentation objects instead of just having them\nin method instances. This allows us to associate any object\nwith an spec example.
\n\nThis way you can have a single Fancy spec example that\nis related to many objects (methods, constants, classes)\nthat are being specified. Later in documentation, we can\nprovide links to all specs where an object is being exercised.
\n\n\n\n"}}, doc:"A Fancy Documentation object is a holder for docstrings and specs.\nKeeps a registry of documentation for anything Fancy.
\n\nProvides methods for searching and formatting an Object's docstrings.\nThis can be be handy for users of the interactive Fancy REPL,\ndocument generators, instrospection tools, IDEs, anything!
\n\nThis object can be converted to just anything by using its format:\nmethod. Formatters can be registered with Fancy Documentation#formatter:is:
\n\nBy default two formatters are defined:
\n\n'fancy => Returns the Fancy::Documentation object\n 'string => Returns the docs string representation
\n\n\n\n", methods:{"for:append:":{file:"lib/documentation.fy", lines:[70, 70], doc:"Append docstring to the documentation for obj.\nIf obj has no documentation, one is created for it.
\n\n\n\n", arg:["obj", "docstring"]}, "remove:":{file:"lib/rbx/documentation.fy", lines:[55, 55], doc:"Removes the documentation for obj.
\n\n\n\n", arg:["obj"]}, "formatter:is:":{file:"lib/documentation.fy", lines:[91, 91], doc:"Registers a callable object as formatter under name.
\n\n\n\n", arg:["name", "callable"]}, ":formatters":{file:"lib/documentation.fy", lines:[100, 100], doc:"Obtain the hash of known documentation formatters.
\n\n\n\n", arg:[]}, "for:is:":{file:"lib/rbx/documentation.fy", lines:[38, 38], doc:"Create a Fancy::Documentation instance.
\n\nNote: As we're bootstrapping, we cannot set documentation here as\nan string literal.
\n\nWe are the very first thing to load, so just create a new\nFancy::Documentation object without using new:, and set it as\nfancy docs.
\n\n\n\n", arg:["obj", "docstring"]}, "for:":{file:"lib/rbx/documentation.fy", lines:[50, 50], doc:"Obtains the Fancy Documentation for obj.
\n\n\n\n", arg:["obj"]}, "formatter:":{file:"lib/documentation.fy", lines:[83, 83], doc:"Obtains a formatter by a given name. Returns a callable object.
\n\n\n\n", arg:["name"]}}}, "TrueClass":{ancestors:["TrueClass", "ImmediateValue", "Object", "Kernel"], instance_methods:{":not":{file:"lib/true_class.fy", lines:[70, 70], doc:"\n\n \n\n", arg:[]}, "if_true:":{file:"lib/true_class.fy", lines:[24, 24], doc:"Calls block
with self
.
Calls then_block
with self
.
TrueClass. The class of the singleton true
value.
Console class. Used for STDIO
.
Prints a newline to STDOUT
.
Prints a given object on STDOUT
, followed by a newline.
Reads a line from STDIN
and returns it as a String
.
Prints a given object on STDOUT
.
Clears the Console
.
Prints a given message to STDOUT
, followed by reading a line from\nSTDIN
.
Returns the superior element in the Enumerable
that has met\nthe given comparison block with all other elements,\napplied to whatever selection_block
returns for each element.
Examples:
\n\n [1,2,5,3,4] superior_by: '> # => 5\n [1,2,5,3,4] superior_by: '< # => 1\n [[1,2], [2,3,4], [], [1]] superior_by: '> taking: 'size # => [2,3,4]\n [[1,2], [2,3,4], [-1]] superior_by: '< taking: 'first # => [-1]\n
\n\n \n\n", arg:["comparison_block", "selection_block"]}, ":first":{file:"lib/enumerable.fy", lines:[320, 320], doc:"\n\n \n\n", arg:[]}, "sort_by:":{file:"lib/enumerable.fy", lines:[477, 477], doc:"Sorts a collection by a given comparison block.
\n\n \n\n", arg:["block"]}, "inject:into:":{file:"lib/enumerable.fy", lines:[267, 267], doc:"Same as reduce:init_val: but taking the initial value as first\nand the reducing block as second parameter.
\n\nExample:
\n\n [1,2,3] inject: 0 into: |sum val| { sum + val } # => 6\n
\n\n\n\n", arg:["val", "block"]}, "reverse_each:":{file:"lib/enumerable.fy", lines:[531, 531], doc:"Runs block
for each element on reversed version of self.\nIf self
is not a sorted collection, no guarantees about the reverse order can be given.
Example:
\n\n 0 upto: 10 . partition_by: |x| { x < 3 } # => [[0, 1, 2], [3, 4, 5, 6, 7, 8, 9, 10]]\n
\n\n \n\n", arg:["block"]}, "each:in_between:":{file:"lib/enumerable.fy", lines:[23, 23], doc:"Similar to each:
but calls an additional Block
between\ncalling the first Block
for each element in self.
Returns the maximum value in the Enumerable (via the '>' comparison message).
\n\n \n\n", arg:[]}, "map:":{file:"lib/enumerable.fy", lines:[123, 123], doc:"Returns a new Array
with the results of calling a given block for every element.
Returns the last element in an Enumerable.
\n\n \n\n", arg:[]}, ":uniq":{file:"lib/enumerable.fy", lines:[279, 279], doc:"Returns a new Array with all unique values (double entries are skipped).
\n\nExample:
\n\n [1,2,1,2,3] uniq # => [1,2,3]\n
\n\n \n\n", arg:[]}, "take_while:":{file:"lib/enumerable.fy", lines:[170, 170], doc:"Returns a new Array
by taking elements from the beginning\nas long as they meet the given condition block.
Example:
\n\n [1,2,3,4,5] take_while: |x| { x < 4 } # => [1,2,3]\n
\n\n \n\n", arg:["condition"]}, ":product":{file:"lib/enumerable.fy", lines:[418, 418], doc:"Calculates the product of all the elements in the Enumerable
\n(assuming them to be Number
s (implementing +
& *
)).
Example usage:
\n\n [1,2,3,4,5] in_groups_of: 3 # => [[1,2,3],[4,5]]\n
\n\n \n\n", arg:["size"]}, "reject:":{file:"lib/enumerable.fy", lines:[151, 151], doc:"Similar to select:
but inverse.\nReturns a new Array
with all elements that don't meet the given condition block.
Joins a collection with a String
between each element, returning a new String
.
\"hello, world\" join: \"-\" # => \"h-e-l-l-o-,- -w-o-r-l-d\"\n
\n\n \n\n", arg:["str"]}, ":empty?":{file:"lib/enumerable.fy", lines:[309, 309], doc:"Indicates, if the Enumerable is empty (has no elements).
\n\n \n\n", arg:[]}, ":compact":{file:"lib/enumerable.fy", lines:[348, 348], doc:"Returns a new Array
with all values removed that are nil
( return true
on nil?
).
Example:
\n\n [1,2,nil,3,nil] compact # => [1,2,3]\n
\n\n \n\n", arg:[]}, ":reverse":{file:"lib/enumerable.fy", lines:[518, 518], doc:"Returns self
in reverse order.\nThis only makes sense for collections that have an ordering.\nIn either case, it simply converts self
to an Array
and returns it in reversed order.
Forward to message superior_by:taking:
\n\n\n\n", arg:["comparison_block"]}, "all?:":{file:"lib/enumerable.fy", lines:[78, 78], doc:"Takes condition-block and returns true
if all elements meet it.
Returns nil
, if item
(or anything that returns true
when comparing to item
) isn't found.\nOtherwise returns that element that is equal to item
.
Similar to find:
but takes a block that is called for each element to find it.
Example:
\n\n [1,2,3,4,5] drop: 2 # => [3,4,5]\n
\n\n \n\n", arg:["amount"]}, ":size":{file:"lib/enumerable.fy", lines:[295, 295], doc:"Returns the size of an Enumerable.
\n\n \n\n", arg:[]}, "any?:":{file:"lib/enumerable.fy", lines:[62, 62], doc:"Indicates, if any element meets the condition.
\n\n \n\n", arg:["condition"]}, "take:":{file:"lib/enumerable.fy", lines:[218, 218], doc:"Example:
\n\n [1,2,3,4] take: 2 # => [1,2]\n
\n\n \n\n", arg:["amount"]}, "drop_while:":{file:"lib/enumerable.fy", lines:[191, 191], doc:"Similar to take_while:
but inverse.\nReturns a new Array
by skipping elements from the beginning\nas long as they meet the given condition block.
Example:
\n\n [1,2,3,4,5] drop_while: |x| { x < 4 } # => [4,5]\n
\n\n\n\n", arg:["condition"]}, ":sum":{file:"lib/enumerable.fy", lines:[409, 409], doc:"Calculates the sum of all the elements in the Enumerable
\n(assuming them to be Number
s (implementing '+' & '*')).
Returns a new Array
with all elements that meet the given condition block.
Indicates, if a collection includes a given element.
\n\n \n\n", arg:["item"]}, "reduce:init_val:":{file:"lib/enumerable.fy", lines:[250, 250], doc:"Calculates a value based on a given block to be called on an accumulator\nvalue and an initial value.
\n\nExample:
\n\n [1,2,3] reduce: |sum val| { sum + val } init_val: 0 # => 6\n
\n\n\n\n", arg:["block", "init_val"]}, ":random":{file:"lib/enumerable.fy", lines:[460, 460], doc:"\n\n \n\n", arg:[]}, ":min":{file:"lib/enumerable.fy", lines:[400, 400], doc:"Returns the minimum value in the Enumerable (via the '<' comparison message).
\n\n \n\n", arg:[]}}, doc:"Mixin-Class with useful methods for collections that implement an each:
method.
Returns an element at a given indes.\nPossibly throws an Rubinius
ObjectBoundsExceededError
.
Compares two Tuple
s with each other.
Calls a given Block
with each element in the Tuple
.
Example:
\n\n (1,2,3) reverse_each: <code data-lang=\"fancy\">{print</code>}\n # prints: 321\n
\n\n \n\n", arg:["block"]}, "at:put:":{file:"lib/rbx/tuple.fy", lines:[44, 44], doc:"Sets a value for a given index within a Tuple
.
Sets a value for a given index within a Tuple
.
Forwards to Tuple
#at:.
Tuples are fixed-size containers providing index-based access to its\nelements.
\n\n\n\n", methods:{"new:":{file:"lib/rbx/tuple.fy", lines:[16, 16], doc:"Initializes a new Tuple
with a given amount of element slots.\nE.g. if size
is 2
, creates a 2-Tuple.
Matches Tuple
class against an object.\nIf the given object is a Tuple instance, return a Tuple object.
Returns the name of the method that was not found as a String
.
Exception class that gets thrown when a method wasn't found within a class.
\n\n\n\n", methods:{}}, "Fancy BreakIteration":{ancestors:["Fancy BreakIteration", "StandardError", "Exception", "Object", "Kernel"], instance_methods:{}, doc:"Raised to break the current iteration.\nIt is rescued by Block#loop.
\n\nExample:
\n\n 10 times: |i| {\n i println\n if: (i == 3) then: {\n Fancy BreakIteration new raise!\n }\n }\n \"Done!\" println\n
\n\nProduces:
\n\n 0\n 1\n 2\n 3\n Done!\n
\n\n\n\n", methods:{}}, "Actor":{ancestors:["Actor", "Object", "Kernel"], instance_methods:{}, doc:"Primitive Actor class.\nActors can be sent messages asynchronously. They process incoming messages\n(which can be any object, including Tuples, Arrays, Numbers ...) in a\nfirst-come, first-serve manner.
\n\nActors are used to implement asynchronous and future message sends in Fancy\nusing the @
and @@
syntax.
Example usage:
\n\na = Actor spawn: {
\n\n loop: {\n match Actor receive {\n case 'hello -> \"Hello World\" println\n case 'quit ->\n \"OK, done!\" println\n break # Quit loop and let actor die\n }\n }\n
\n\n}
\n\n10 times: {
\n\n a ! 'hello # send 'hello to actor asynchronously\n
\n\n}\n a ! 'quit
\n\n\n\n", methods:{"spawn:":{file:"lib/rbx/actor.fy", lines:[51, 51], doc:"Example usage:
\n\n Actor spawn: {\n loop: {\n Actor receive println # print all incoming messages\n }\n }\n
\n\n \n\n", arg:["block"]}}}, "String":{ancestors:["String", "FancyEnumerable", "Object", "Enumerable", "Comparable", "Object", "Kernel"], instance_methods:{":blank?":{file:"lib/string.fy", lines:[42, 42], doc:"Indicates, if a String
consists only of whitespace.
Returns a Substring from from
to to
.
Appends another String
onto this String
.
Example usage:\n str = \"hello\"\n str append: \" world!\"\n str # => \"hello world!\"
\n\n \n\n", arg:["string"]}, ":*":{file:"lib/string.fy", lines:[58, 58], doc:"Returns a String
that is the num-fold concatenation of itself.
\"foo\" * 3 # => \\\342\200\235foofoofoo\"\n
\n\n \n\n", arg:["num"]}, ":lines":{file:"lib/string.fy", lines:[102, 102], doc:"Returns the lines of a String
as an Array
.
Evaluates a String
in the current Binding
and returns its value.
Appends object's
String
representation to self
.
Example:
\n\n str = \"hello\"\n str << \" \"\n str << 42\n str # => \"hello 42\"\n
\n\n \n\n", arg:["object"]}, ":[]":{file:"lib/rbx/string.fy", lines:[24, 24], doc:"Given an Array of 2 Numbers, it returns the substring between the given indices.\nIf given a Number, returns the character at that index.
\n\n\n\n", arg:["index"]}, ":characters":{file:"lib/string.fy", lines:[144, 144], doc:"\n\n \n\n", arg:[]}, ":words":{file:"lib/string.fy", lines:[72, 72], doc:"\"hello world\" words # => [\"hello\", \"world\"]
\n\n \n\n", arg:[]}, "at:":{file:"lib/rbx/string.fy", lines:[53, 53], doc:"Returns the character (as a String
) at index idx
.
Indicates, if a String
is empty or a single whitespace character.
Calls a given Block
with each character in a String
.
Remove leading white space for multi-line strings.\nThis method expects the first character to be an line return.
\n\n\n\n", arg:[]}, ":character":{file:"lib/string.fy", lines:[151, 151], doc:"\n\n \n\n", arg:[]}, "split:":{file:"lib/rbx/string.fy", lines:[62, 62], doc:"\n\n \n\n", arg:["str"]}, ":split":{file:"lib/rbx/string.fy", lines:[71, 71], doc:"Splits a string by whitespace.
\n\n \n\n", arg:[]}, ":++":{file:"lib/string.fy", lines:[22, 22], doc:"Concatenate self
with another Object's String
representation.
\"foo\\\342\200\235 ++ 42 # => \\\342\200\235foo42\\\342\200\235\n
\n\n \n\n", arg:["other"]}, "includes?:":{file:"lib/rbx/string.fy", lines:[148, 148], doc:"Indicates if a given substring is in self
.
Returns a String
containing all but the first character.
\"hello\" rest # => \"ello\"\n
\n\n \n\n", arg:[]}, ":raise!":{file:"lib/string.fy", lines:[80, 80], doc:"Raises a new StandardError
with self as the message.
Same as String#eval
but evaluates self
in the global binding.
Strings are sequences of characters and behave as such.\nAll literal Strings within Fancy code are instances of the String\nclass.
\n\nThey also include FancyEnumerable, which means you can use all the\ncommon sequence methods on them, like +map:+, +select:+ etc.
\n\n\n\n", methods:{}}, "Fancy Package RubyDependency":{ancestors:["Fancy Package RubyDependency", "Object", "Kernel"], instance_methods:{"initialize:":{file:"lib/package/dependency.fy", lines:[22, 22], doc:"Forward to message initialize:version:
\n\n\n\n", arg:["@gem_name"]}}, doc:"Same as Fancy
Package
Dependency
, just for rubygem packages.
Executes a given Block
while self evals to nil
or false
.
Example:
\n\n i = 0\n { i >= 10 } while_false: {\n i println\n i = i + 1\n }\n
\n\n\n\n", arg:["block"]}, ":receiver":{file:"lib/rbx/block.fy", lines:[38, 38], doc:"Returns the receiver of the Block
(value for self
)
Calls a given Block as long as self
yields nil
or false
.
Calls work
while calling self
yields a true-ish
value.
Turns a Block
into a Ruby Proc object.
Calls work
while calling self
yields a true-ish
value.
Short-circuiting || (boolean OR).
\n\n\n\n", arg:["other_block"]}, "until:":{file:"lib/block.fy", lines:[69, 69], doc:"Calls self
while block
yields nil
or false
.
Calls self
if obj
is true-ish.
Short-circuiting && (boolean AND).
\n\n\n\n", arg:["other_block"]}, "unless:":{file:"lib/block.fy", lines:[109, 109], doc:"Opposite of Block#if:. Calls self
if obj
is false-ish.
Executes a given Block
while self evals to nil
or false
.
Example:
\n\n i = 0\n { i >= 10 } while_false: {\n i println\n i = i + 1\n }\n
\n\n\n\n", arg:["block"]}, ":===":{file:"lib/block.fy", lines:[121, 121], doc:"Matches a Block
against another object by calling self
with val
.
Sets the receiver (value for self
) of a Block
.
The Block class (also BlockEnvironment) is the class of all\nBlock-literal values.\nA Block is a piece of unevaluated code, that can be passed around as\nany other value and evaluated by calling the +call+ or +call:+ methods.
\n\nBlocks also work properly with their enclosing environment in that\nthey preserve any local variables that get used within the Block,\neven if the context in which they got defined has been destroyed.\n=> Blocks are proper closures.
\n\nSee: http://en.wikipedia.org/wiki/Closure_(computer_science) for\nmore information.
\n\n\n\n", methods:{}}, "Number":{ancestors:["Number", "Object", "Kernel"], instance_methods:{":negate":{file:"lib/number.fy", lines:[119, 119], doc:"Negates a Number (-1 becomes 1 and vice versa).
\n\n \n\n", arg:[]}, ":abs":{file:"lib/number.fy", lines:[110, 110], doc:"Returns the absolute (positive) value of a Number.
\n\n \n\n", arg:[]}, ":even?":{file:"lib/number.fy", lines:[129, 129], doc:"Indicates, if a Number is even.
\n\n \n\n", arg:[]}, "min:":{file:"lib/number.fy", lines:[164, 164], doc:"\n\n \n\n", arg:["other"]}, "upto:do:":{file:"lib/number.fy", lines:[34, 34], doc:"Calls block
with each Number
between self
and num
.\nExpects num
to be greater or equal to self
.
Returns an Array with Numbers starting at self
and going down to num
.\nExpects num
to be smaller or equal to self
.
Indicates, if a Number is odd.
\n\n \n\n", arg:[]}, "upto:":{file:"lib/number.fy", lines:[16, 16], doc:"Returns an Array with Numbers starting at self
and going up to num
.\nExpects num
to be greater or equal to self
.
Returns the square of a Number.
\n\n \n\n", arg:[]}, ":doubled":{file:"lib/number.fy", lines:[95, 95], doc:"Returns the double value of a Number.
\n\n \n\n", arg:[]}, "downto:do:":{file:"lib/number.fy", lines:[70, 70], doc:"Calls block
with each Number
between self
and num
.\nExpects num
to be smaller or equal to self
.
Number is a mixin-class for all number values (integer & floats for\nnow).
\n\n\n\n", methods:{}}, "Float":{ancestors:["Float", "Number", "Object", "Precision", "Numeric", "Comparable", "Object", "Kernel"], instance_methods:{}, doc:"Standard class for floating point number values in Fancy.
\n\n\n\n", methods:{}}, "FalseClass":{ancestors:["FalseClass", "ImmediateValue", "Object", "Kernel"], instance_methods:{":not":{file:"lib/false_class.fy", lines:[62, 62], doc:"Boolean negation of false
=> true
.
Returns nil
.
Calls else_block
.
Returns an empty Array
.
Returns false
as a String
.
Returns true
.
Returns false
as a String
.
FalseClass. The class of the singleton false
value.
A documentation formatter using ruby's RDiscount markdown
\n\n\n\n", methods:{"rdiscount:":{file:"lib/documentation.fy", lines:[123, 123], doc:"Format string as HTML using RDiscount ruby gem.
\n\n\n\n", arg:["doc"]}}}, "TCPServer":{ancestors:["TCPServer", "Socket ListenAndAccept", "IO Socketable", "TCPSocket", "IPSocket", "BasicSocket", "IO", "IOMixin", "Object", "Unmarshalable", "File Constants", "Enumerable", "Object", "Kernel"], instance_methods:{}, doc:"TCP Server
\n\n\n\n", methods:{}}, "Object":{ancestors:["Object", "Kernel"], instance_methods:{"send_async:with_params:":{file:"lib/object.fy", lines:[525, 525], doc:"Sends message
with params
to self
asynchronously and immediately returns nil
.
Calls else_block
(default behaviour).
Breaks / Stops current iteration.
\n\n\n\n", arg:[]}, ":to_enum":{file:"lib/object.fy", lines:[155, 155], doc:"\n\n \n\n", arg:[]}, "returning:do:":{file:"lib/object.fy", lines:[348, 348], doc:"Returns value
after calling block
with it.\nUseful for returning some object after using it, e.g.:
# this will return [1,2]\n returning: [] do: |arr| {\n arr << 1\n arr << 2\n }\n
\n\n \n\n\n\n", arg:["value", "block"]}, ":to_a":{file:"lib/object.fy", lines:[139, 139], doc:"\n\n \n\n", arg:[]}, "do:while:":{file:"lib/object.fy", lines:[261, 261], doc:"\n\n \n\n", arg:["body_block", "cond_block"]}, "while:do:":{file:"lib/object.fy", lines:[243, 243], doc:"Same as:\ncond_block while_do: body_block
\n\n\n\n", arg:["cond_block", "body_block"]}, "next:":{file:"lib/object.fy", lines:[425, 425], doc:"Returns value
for current iteration and skip to the next one.
Calls #value on future
. Shortcut method.
Boolean conjunction.\nIf self
and other
are both true-ish (non-nil, non-false), returns other
.\nIf other
is a Block
, calls it and returns its return value.
Returns the Object's actor.\nIf none exists at this moment, a new one will be created\nand starts running in the background.
\n\n\n\n", arg:[]}, "loop:":{file:"lib/object.fy", lines:[26, 26], doc:"Infinitely calls the block (loops).
\n\n \n\n", arg:["block"]}, ":dclone":{file:"lib/rbx/object.fy", lines:[19, 19], doc:"Returns a deep clone of self using Ruby's Marshal class.
\n\n\n\n", arg:[]}, "if_true:":{file:"lib/object.fy", lines:[70, 70], doc:"Calls the block
(default behaviour).
Calls the then_block
(default behaviour).
Helper method that calls block
with self
as the receiver.\nThis allows message cascading like code, e.g.:
some_complex_object do: {\n method_1: arg1\n method_2: arg2\n method_3: arg3\n }\n\n # this is the same as:\n some_complex_object method_1: arg1\n some_complex_object method_2: arg2\n some_complex_object method_3: arg3\n
\n\n \n\n", arg:["block"]}, "send_async:":{file:"lib/object.fy", lines:[516, 516], doc:"Forward to message send_async:with_params:
\n\n\n\n", arg:["message"]}, "receive_message:with_params:":{file:"lib/rbx/object.fy", lines:[112, 112], doc:"Dynamically sends a given message with parameters to self
.
Skip to the next iteration.
\n\n\n\n", arg:[]}, ":nil?":{file:"lib/object.fy", lines:[115, 115], doc:"\n\n \n\n", arg:[]}, "receive_message:":{file:"lib/rbx/object.fy", lines:[101, 101], doc:"Dynamically sends a given message (without parameters) to self
.
Same as Fiber##yield.
\n\n\n\n", arg:[]}, "set_slot:value:":{file:"lib/rbx/object.fy", lines:[39, 39], doc:"Sets an object's slot with a given value.
\n\n \n\n", arg:["slotname", "val"]}, "sleep:":{file:"lib/object.fy", lines:[610, 610], doc:"Sets the current Thread (in which self is running) for a given amount to sleep.
\n\n \n\n", arg:["seconds"]}, ":true?":{file:"lib/object.fy", lines:[131, 131], doc:"\n\n \n\n", arg:[]}, ":!=":{file:"lib/object.fy", lines:[59, 59], doc:"Indicates, if two objects are not equal.
\n\n \n\n", arg:["other"]}, "require:":{file:"lib/rbx/object.fy", lines:[14, 14], doc:"Loads and evaluates a given Fancy source file by trying to find the specified\nRelative paths are allowed (and by default expected).
\n\n \n\n", arg:["file_path"]}, "responds_to?:":{file:"lib/rbx/object.fy", lines:[132, 132], doc:"Indicates if an object responds to a given message.
\n\n \n\n", arg:["message"]}, "yield:":{file:"lib/object.fy", lines:[407, 407], doc:"Same as Fiber##yield:
\n\n\n\n", arg:["values"]}, ":to_s":{file:"lib/rbx/object.fy", lines:[28, 28], doc:"\n\n \n\n", arg:[]}, "define_singleton_method:with:":{file:"lib/rbx/object.fy", lines:[60, 60], doc:"Dynamically defines a method on self's
metaclass (a singleton method) using a given Block
.
Same as:\nConsole print: self
\n\nPrints self
on STDOUT.
Same as:\ncond if_true: block
\n\n\n\n", arg:["cond", "block"]}, "until:do:":{file:"lib/object.fy", lines:[252, 252], doc:"Same as:\ncond_block until_do: body_block
\n\n\n\n", arg:["cond_block", "body_block"]}, "documentation:":{file:"lib/object.fy", lines:[319, 319], doc:"Sets the documentation string for an Object.
\n\n \n\n", arg:["docstring"]}, "is_a?:":{file:"lib/rbx/object.fy", lines:[82, 82], doc:"Indicates, if an object is an instance of a given Class.
\n\n \n\n", arg:["class"]}, ":die!":{file:"lib/object.fy", lines:[491, 491], doc:"Tells an object to let its actor to die (quit running).
\n\n\n\n", arg:[]}, "do:until:":{file:"lib/object.fy", lines:[271, 271], doc:"\n\n \n\n", arg:["body_block", "cond_block"]}, ":<=>":{file:"lib/object.fy", lines:[564, 564], doc:"\n\n \n\n", arg:["other"]}, "xor:":{file:"lib/object.fy", lines:[214, 214], doc:"\n\n \n\n", arg:["other"]}, "if:then:else:":{file:"lib/object.fy", lines:[234, 234], doc:"Same as:\ncond if_true: then_block else: else_block
\n\n\n\n", arg:["cond", "then_block", "else_block"]}, "if_nil:else:":{file:"lib/object.fy", lines:[104, 104], doc:"Calls else_block
(default behaviour).
Returns a RespondsToProxy
for self
that forwards any messages\nonly if self
responds to them.
Example:
\n\n # only send 'some_message: if object responds to it:\n object if_responds? some_message: some_parameter\n
\n\n \n\n\n\n", arg:[]}, "unless:do:":{file:"lib/object.fy", lines:[281, 281], doc:"Same as:\ncond if_true: { nil } else: block
\n\n\n\n", arg:["cond", "block"]}, "let:be:":{file:"lib/object.fy", lines:[613, 613], doc:"Forward to message let:be:in:
\n\n\n\n", arg:["var_name", "value"]}, ":documentation":{file:"lib/object.fy", lines:[309, 309], doc:"Returns the Fancy
Documentation
object for an Object.
Same as Object#is_a?:\nIndicates, if an object is an instance of a given Class.
\n\n\n\n", arg:["class"]}, "send_future:":{file:"lib/object.fy", lines:[504, 504], doc:"Forward to message send_future:with_params:
\n\n\n\n", arg:["message"]}, ":println":{file:"lib/object.fy", lines:[37, 37], doc:"Same as:\nConsole println: self
\n\nPrints self
on STDOUT
, followed by a newline.
Does nothing (default behaviour).
\n\n \n\n\n\n", arg:["block"]}, "let:be:in:":{file:"lib/object.fy", lines:[630, 630], doc:"Dynamically rebinds var_name
as dynamic variable with value
as the value within block
.
Example:
\n\n File open: \"/tmp/output.txt\" modes: ['write] with: |f| {\n let: '*stdout* be: f in: {\n \"hello, world!\" println # writes it to file not STDOUT\n }\n }\n
\n\n \n\n\n\n", arg:["var_name", "value", "block"]}, "undefine_singleton_method:":{file:"lib/rbx/object.fy", lines:[70, 70], doc:"Undefines a singleton method of self
.
The identity method simply returns self.
\n\n \n\n", arg:[]}, "to_enum:":{file:"lib/object.fy", lines:[164, 164], doc:"\n\n \n\n", arg:["iterator"]}, "break:":{file:"lib/object.fy", lines:[443, 443], doc:"Returns value
from iteratioen.
This is the default implementation for backtick: which gets called when using the backtick syntax.\nFor example:\ncat README
\nGets translated to the following message send:\nself backtick: \"cat README\"\nWhich allows for custom implementations of the backtick: method, if needed.\nThis default implementation works the same way as in Ruby, Perl or Bash.\nIt returns the output of running the given string on the command line as a String
.
Same as:\ncond if_true: else_block else: block
\n\n\n\n", arg:["cond", "block", "else_block"]}, "extend:":{file:"lib/rbx/object.fy", lines:[141, 141], doc:"Extends self
with the methods in class
(by including its methods in self's
metaclass).
Creates a FutureSend
object (a Future / Promise) that will hold the value of sending message
to self
.
Boolean disjunction.\nIf self
is true-ish (non-nil, non-false) returns self
.\nOtherwise returns other
(if other
is a Block
, calls it first and returns its return value)
Runs a given Block
in a synchronized fashion if called by multiple Threads.\nUses a Mutex
in the background for synchronization (created on demand for each Object
).
Does nothing (default behaviour).
\n\n \n\n\n\n", arg:["block"]}, ":to_i":{file:"lib/object.fy", lines:[147, 147], doc:"\n\n \n\n", arg:[]}, "and:":{file:"lib/object.fy", lines:[183, 183], doc:"Boolean conjunction.\nIf self
and other
are both true-ish (non-nil, non-false), returns other
.\nIf other
is a Block
, calls it and returns its return value.
Returns the String
concatenation of self
and other
.\nCalls to_s on self
and other
and concatenates the results to a new String
.
Boolean disjunction.\nIf self
is true-ish (non-nil, non-false) returns self
.\nOtherwise returns other
(if other
is a Block
, calls it first and returns its return value)
Returns the value of a slot of self
.
Returns the method with a given name for self, if defined.
\n\n \n\n", arg:["method_name"]}, ":slots":{file:"lib/object.fy", lines:[598, 598], doc:"\n\n \n\n", arg:[]}}, doc:"Root class of Fancy's class hierarchy.\nAll classes inherit from Object.
\n\n\n\n", methods:{}}, "Fancy FDoc":{ancestors:["Fancy FDoc", "Object", "Kernel"], instance_methods:{}, doc:"FDoc is a tool to generate API documentation from Fancy source.
\n\nWorks as follows:
\n\nFDoc will load all .fy files you give to it, and optionally run\nany specified FancySpec, and later produce documentation output.
\n\n\n\n", arg:[]}}}, "System":{ancestors:["System", "Object", "Kernel"], instance_methods:{}, doc:"System class. Holds system-wide relevant methods.
\n\n\n\n", methods:{"pipe:do:":{file:"lib/rbx/system.fy", lines:[65, 65], doc:"Runs the given string as a popen3() call, passing in a given Block
.\nThe Block
is expected to take 3 arguments for STDIN
, STDOUT
and STDERR
.
Runs the given string as a popen3() call and returns a IO handle\nthat can be read from
\n\n \n\n", arg:["command_str"]}, "do:":{file:"lib/rbx/system.fy", lines:[31, 31], doc:"Runs the given string as a system() command.
\n\n\n\n", arg:["command_str"]}, "piperead:":{file:"lib/rbx/system.fy", lines:[40, 40], doc:"Runs the given string as a popen() call and returns the output\nof the call as a string.
\n\n\n\n", arg:["command_str"]}, "exit:":{file:"lib/rbx/system.fy", lines:[23, 23], doc:"Exit the running Fancy process with a given exit code.
\n\n \n\n", arg:["exitcode"]}, ":exit":{file:"lib/rbx/system.fy", lines:[13, 13], doc:"Exit the running Fancy process.
\n\n\n\n", arg:[]}}}, "Fiber":{ancestors:["Rubinius Fiber", "Object", "Kernel"], instance_methods:{"resume:":{file:"lib/rbx/fiber.fy", lines:[39, 39], doc:"Resumes self
(if paused) or raises an exception, if Fiber
is dead.\nPasses along vals
as the return value of the last call to yield
in self
.
Fiber class. Fibers are cooperatively scheduled coroutines supported\nby the Rubinius VM.\nControl flow between multiple Fibers is always explicitly handled.\nThere is no preemptive scheduler.
\n\n\n\n", methods:{"new:":{file:"lib/rbx/fiber.fy", lines:[18, 18], doc:"Creates a new Fiber running block
.
Returns execution control to the parent Fiber
and passes along vals
.
Similar to #times: but starts at a given offset.
\n\n \n\n", arg:["block", "offset"]}, "times:":{file:"lib/rbx/integer.fy", lines:[19, 19], doc:"Calls a given Block
with each number between 0 and self
.
Base class for integer values in Fancy.
\n\n\n\n", methods:{}}, "Time":{ancestors:["Time", "Comparable", "Object", "Kernel"], instance_methods:{}, doc:"Time class. Used for even more timely stuff.
\n\n\n\n", methods:{}}, "UnboundMethod":{ancestors:["UnboundMethod", "MethodMixin", "Object", "Object", "Kernel"], instance_methods:{}, doc:"An instance UnboundMethod represents a Method object not bound to a specific Class
or Object
.
A documentation formater intended to be used by FDoc
.
This formatter makes some transformations on a docstring\nand then converts it to html using markdown.
\n\n\n\n", methods:{"create_class_references:":{file:"lib/fdoc.fy", lines:[256, 256], doc:"Creates class references for Fancy class names.
\n\nA docstring may contain class names sorounded by @\nwithout space between the @.
\n\nNested classes can be indicated by using :: like
\n\nFoo::Bar
\n\nThis will create references for both, Foo
and Bar
Instance methods should be written:
\n\nFoo::Bar#baz
\n\nClass methods should be written:
\n\nFoo::Bar.baz
\n\nSome examples:
\n\nA simple class reference:
\n\nFancy
Nested class reference:
\n\nFancy
FDoc
A fancy method without arguments:
\n\nFancy
FDoc
JSON
generate_map
A ruby method reference (will link to ruby docs if available)
\n\nString
split
A fancy method with many arguments:
\n\nFancy
Package
Installer
initialize:version:install_path:
A singleton method:
\n\nFancy
FDoc
Formatter
format:
Creates a new Exception with a given message.
\n\n \n\n", arg:["msg"]}, ":initialize":{file:"lib/rbx/exception.fy", lines:[16, 16], doc:"Creates a new Exception with an empty message.
\n\n\n\n", arg:[]}, ":raise!":{file:"lib/rbx/exception.fy", lines:[35, 35], doc:"Raises (throws) an Exception to be caught somewhere up the\ncallstack.
\n\n\n\n", arg:[]}}, doc:"StandardError. Base class of most Exception classes.
\n\n\n\n", methods:{}}, "Fancy Package Installer":{ancestors:["Fancy Package Installer", "Object", "Kernel"], instance_methods:{"download_url:":{file:"lib/package/installer.fy", lines:[110, 110], doc:"Returns the download url for a given version of the package\nto be installed.
\n\n\n\n", arg:["version"]}, "initialize:":{file:"lib/package/installer.fy", lines:[44, 44], doc:"Forward to message initialize:version:install_path:
\n\n\n\n", arg:["@package_name"]}, "rename_dir:":{file:"lib/package/installer.fy", lines:[158, 158], doc:"Renames a given directory to a common way within the install path.\n=> It will rename the given dirname to $user/$repo-$version.
\n\n\n\n", arg:["dirname"]}, ":latest_tag":{file:"lib/package/installer.fy", lines:[82, 82], doc:"Returns the latest tag (sorted alphabetically).
\n\n\n\n", arg:[]}, ":run":{file:"lib/package/installer.fy", lines:[52, 52], doc:"Runs the installer & installs the package into\n$FANCY_PACKAGE_DIR
.
Forward to message initialize:version:install_path:
\n\n\n\n", arg:["@package_name", "@version"]}, ":load_fancypack":{file:"lib/package/installer.fy", lines:[167, 167], doc:"Loads the @.fancypack file within the downloaded package directory.\nIf no @.fancypack file is found, raise an error.
\n\n\n\n", arg:[]}, ":tags":{file:"lib/package/installer.fy", lines:[91, 91], doc:"Returns a list of tags the repository has on Github.
\n\n\n\n", arg:[]}, "initialize:version:install_path:":{file:"lib/package/installer.fy", lines:[44, 44], doc:"Creates a new Package
Installer@ for a given package name, an\noptional version (default is 'latest') and an optional\ninstallation path (default is the standard installation path for\nFancy packages).
Indicates, if a given version is available on Github.
\n\n\n\n", arg:["version"]}, "download_tgz:":{file:"lib/package/installer.fy", lines:[135, 135], doc:"Downloads the .tar.gz file from Github with the given version\n(tag or branch name) and saves it to the specified install_path
.
The Default install_path is ~/.fancy/packages/.\nIf an environment variable FANCY_PACKAGE_DIR
is defined, it\nwill get used.
Fancy
Package
installer.
Downloads packages from Github (usually the latest tagged version,\nif no version is specified, or the latest HEAD revision in the\nmaster branch) and install it to the FANCY_PACKAGE_DIR
.
Calls a given Block
with each value.
Deletes a key-value pair from self
.
Calls a given Block
with each key.
Calls a given Block
with each key and value.
Indicates if a given key is in self
.
Example:
\n\n <['foo => 1, 'bar => 2, 'baz => 42]> values_at: ('foo, 'baz) # => [1, 42]\n
\n\n \n\n", arg:["keys"]}, ":to_a":{file:"lib/hash.fy", lines:[71, 71], doc:"Returns an Array
of the key-value pairs in a Hash
.
Returns a String
representation of a Hash
.
Returns the value for a given key.
\n\n \n\n", arg:["key"]}}, doc:"Class for Hashes (HashMaps / Dictionaries).\nMaps a key to a value.
\n\n\n\n", methods:{}}, "IO":{ancestors:["IO", "IOMixin", "Object", "Unmarshalable", "File Constants", "Enumerable", "Object", "Kernel"], instance_methods:{}, doc:"Base class for IO related classes (like File
, Socket
, Console
etc.).
Forward to message initialize:version:
\n\n\n\n", arg:["@name"]}}, doc:"Package Dependency.\nRepresents a Dependency to another Package with a given version.
\n\n\n\n", methods:{}}, "Symbol":{ancestors:["Symbol", "ImmediateValue", "Object", "Kernel"], instance_methods:{":call":{file:"lib/symbol.fy", lines:[37, 37], doc:"Sends self
as message to the sender in its context.\nExample:\n'foo call\n # => same as\n self foo
if: x then: 'foo else: 'bar\n # same as:\n if: x then: { self foo } else: { self bar }
\n\n\n\n", arg:[]}, "call:":{file:"lib/symbol.fy", lines:[22, 22], doc:"This allows Symbols to be used like Blocks\n(e.g. in all methods of Enumerable).\nExample:\n[1, 2, 3] map: 'squared # => [1, 4, 9]
\n\n\n\n", arg:["arg"]}, ":defined?":{file:"lib/rbx/symbol.fy", lines:[20, 20], doc:"Indicates if a Symbol is defined as a constant in the senders scope.
\n\n \n\n", arg:[]}}, doc:"Symbols are unique identifiers and only created once.
\n\nIf there are several occurrances of the same Symbol literal within\nFancy code, they all refer to the same Symbol object.
\n\n\n\n", methods:{}}, "Fancy StopIteration":{ancestors:["Fancy StopIteration", "StandardError", "Exception", "Object", "Kernel"], instance_methods:{":result":{file:"lib/iteration.fy", lines:[82, 82], doc:"Returns the return value of the iterator.
\n\no = Object new\ndef o each: block {\n block call: [1]\n block call: [2]\n block call: [3]\n 100\n}
\n\ne = o to_enum\ne next p #=> 1\ne next p #=> 2\ne next p #=> 3\ntry {\n e next\n} catch Fancy StopIteration => ex {\n ex result p #=> 100\n}
\n\n\n\n", arg:[]}}, doc:"Raised to stop the iteration, in particular by Enumerator#next.\nIt is rescued by Block#loop.
\n\nExample:
\n\n {\n 'Hello println\n Fancy StopIteration new raise!\n 'World println\n } loop\n 'Done! println\n
\n\nProduces:
\n\n Hello\n Done!\n
\n\n\n\n", methods:{}}, "Fancy NextIteration":{ancestors:["Fancy NextIteration", "StandardError", "Exception", "Object", "Kernel"], instance_methods:{}, doc:"Raised to continue with next iteration (and stopping the current one).\nIt is rescued by Block#loop.
\n\n\n\n", methods:{}}, "MethodMixin":{ancestors:["MethodMixin", "Object", "Kernel"], instance_methods:{":private?":{file:"lib/rbx/method.fy", lines:[48, 48], doc:"\n\n \n\n", arg:[]}, "documentation:":{file:"lib/rbx/method.fy", lines:[19, 19], doc:"\n\n \n\n", arg:["docstring"]}, ":public?":{file:"lib/rbx/method.fy", lines:[34, 34], doc:"\n\n \n\n", arg:[]}, ":documentation":{file:"lib/rbx/method.fy", lines:[11, 11], doc:"\n\n \n\n", arg:[]}, ":tests":{file:"lib/rbx/method.fy", lines:[57, 57], doc:"Returns an Array of all the FancySpec SpecTests defined for a\nMethod.
\n\n\n\n", arg:[]}, ":visibility":{file:"lib/rbx/method.fy", lines:[26, 26], doc:"\n\n \n\n", arg:[]}, ":protected?":{file:"lib/rbx/method.fy", lines:[41, 41], doc:"\n\n \n\n", arg:[]}}, doc:"Mixin class with common methods included by Method
and UnboundMethod
.
Initializes a new Stack with a given size.
\n\n \n\n", arg:["size"]}, ":initialize":{file:"lib/stack.fy", lines:[11, 11], doc:"Initializes a new Stack.
\n\n\n\n", arg:[]}, ":size":{file:"lib/stack.fy", lines:[59, 59], doc:"\n\n \n\n", arg:[]}, ":top":{file:"lib/stack.fy", lines:[51, 51], doc:"\n\n \n\n", arg:[]}, "each:":{file:"lib/stack.fy", lines:[80, 80], doc:"Calls a given Block
with each element in self
, starting with the top of stack element.
Pushes a value onto the Stack.
\n\n \n\n", arg:["obj"]}, ":pop":{file:"lib/stack.fy", lines:[43, 43], doc:"Pops the top-of-stack element from the Stack and returns it.
\n\n \n\n", arg:[]}, ":empty?":{file:"lib/stack.fy", lines:[69, 69], doc:"Indicates, if the Stack is empty.
\n\n \n\n", arg:[]}, ":<<":{file:"lib/stack.fy", lines:[31, 31], doc:"Pushes a value onto the Stack.
\n\n \n\n", arg:["obj"]}}, doc:"A simple Stack container class.
\n\n\n\n", methods:{}}, "Class":{ancestors:["Class", "Module", "Object", "Kernel"], instance_methods:{"initialize:":{file:"lib/rbx/class.fy", lines:[55, 55], doc:"Initializes a Class
with a superclass.
Defines an alias method for another method.
\n\n \n\n", arg:["new_method_name", "old_method_name"]}, "write_slot:":{file:"lib/class.fy", lines:[85, 85], doc:"Defines a slot writer method for a given slotname.
\n\n \n\n", arg:["slotname"]}, "define_slot_reader:":{file:"lib/class.fy", lines:[25, 25], doc:"Defines a slot reader method with a given name.\nE.g. for a slotname count
it will define the following method:
def count {\n get_slot: 'count\n }\n
\n\n \n\n", arg:["slotname"]}, "subclass:":{file:"lib/rbx/class.fy", lines:[109, 109], doc:"Creates a new Class
with self
as superclass and the given body.
Returns an instance method for a Class
with a given name.
Defines slot reader & writer methods for all given slotnames.
\n\n \n\n", arg:["slots"]}, ":nested_classes":{file:"lib/rbx/class.fy", lines:[119, 119], doc:"Returns all the nested classes within a Class
as an Array
.
Defines a class method on a Class
(a singleton method) with a\ngiven name and body.
Creates a new Class
instance by subclassing Object
.
Creates a method alias for a Ruby method.
\n\n\n\n", arg:["new_method_name", "ruby_method_name"]}, "subclass?:":{file:"lib/class.fy", lines:[127, 127], doc:"Indicates, if a Class is a subclass of another Class.
\n\n \n\n", arg:["class_obj"]}, ":initialize":{file:"lib/rbx/class.fy", lines:[48, 48], doc:"Initializes a Class
with Object
set as superclass (default superclass).
Sets any given method names to private on this Class
.
Sets any given method names to protected on this Class
.
Undefines an instance method on a Class with a given name.
\n\n \n\n", arg:["name"]}, "undefine_class_method:":{file:"lib/rbx/class.fy", lines:[99, 99], doc:"Undefines a class method on a Class
with a given name.
Sets any given method names to public on this Class
.
Creates ruby_alias methods for any unary ruby methods of a class.
\n\n\n\n", arg:[]}, "write_slots:":{file:"lib/class.fy", lines:[72, 72], doc:"Defines slot writer methods for all given slotnames.
\n\n \n\n", arg:["slots"]}, "read_slots:":{file:"lib/class.fy", lines:[50, 50], doc:"Defines slot reader methods for all given slotnames.
\n\n \n\n", arg:["slots"]}, "read_slot:":{file:"lib/class.fy", lines:[63, 63], doc:"Defines a slot reader method for a given slotname.
\n\n \n\n", arg:["slotname"]}, "define_slot_writer:":{file:"lib/class.fy", lines:[41, 41], doc:"Defines a slot writer method with a given name.\nE.g. for a slotname count
it will define the following method:
def count: c {\n set_slot: 'count value: c\n }\n
\n\n \n\n", arg:["slotname"]}, "new:":{file:"lib/rbx/class.fy", lines:[26, 26], doc:"Creates a new Class
instance by subclassing superclass
.
Defines slot reader & writer methods for a given slotname.
\n\n \n\n", arg:["slotname"]}, "define_method:with:":{file:"lib/rbx/class.fy", lines:[67, 67], doc:"Defines an instance method on a Class
with a given name and\nbody.
Rbx specific version of alias_method:for: due to bootstrap order\nreasons. Should not be used directly.
\n\n\n\n", arg:["new_method_name", "old_method_name"]}}, doc:"This class is the class of Class
objects - e.g. Object
, Array
,\nString
etc.\nAny class in the language is an instance of this class, as in Ruby\nor Smalltalk.
Creates a new Class
by subclassing superclass
and\nusing body_block
as its body.
Forward to message initialize:receiver:message:with_params:
\n\n\n\n"}, "FancyEnumerator#each:":{args:["block"], doc:"Calls a given Block
with each element in the collection this enumerator is attached to.\nUsed for iterating over the collection using this enumerator.
Forward to message add_dependency:version:
\n\n\n\n"}, "String#:raise!":{args:[], doc:"Raises a new StdError with self
as the message.
Runs a given block if any of the given options is in ARGV.
\n\n\n\n"}, "FancyEnumerator#:peek":{args:[], doc:"Returns the next object in the FancyEnumerator, but doesn't move the\ninternal position forward.\nWhen the position reaches the end, a Fancy StopIteration exception is\nraised.
\n\nExample:
\n\n a = [1,2,3]\n e = a to_enum\n e next p #=> 1\n e peek p #=> 2\n e peek p #=> 2\n e peek p #=> 2\n e next p #=> 2\n e next p #=> 3\n e next p #=> raises Fancy StopIteration\n
\n\n\n\n"}, "Object#for_option:do:":{args:["op_name", "block"], doc:"Runs a given block if an option is in ARGV.
\n\n\n\n"}, "FancyEnumerator#with:each:":{args:["object", "block"], doc:"Similar to #each: but also passing in a given object
to each invocation of block
.
Forward to message execute_synchronous:with_args:
\n\n\n\n"}, "ThreadPool#execute:":{args:["block"], doc:"Forward to message execute:with_args:
\n\n\n\n"}, "Fancy FDoc JSON#write:":{args:["filename"], doc:"Forward to message write:call:
\n\n\n\n"}, "FancyEnumerator#initialize:":{args:["@collection"], doc:"Initializes a new FancyEnumerator with a given collection
,\nusing #each: for iteration.
Indicates if an enumerator has ended (no more values left).
\n\n \n\n"}, "Fancy Package Specification#add_ruby_dependency:":{args:["gem_name"], doc:"Forward to message add_ruby_dependency:version:
\n\n\n\n"}, "ThreadPool#initialize:":{args:["@count"], doc:"Forward to message initialize:limit:
\n\n\n\n"}, "FancyEnumerator#:rewind":{args:[], doc:"Resets the enumerator to start from the collection's beginning.
\n\n\n\n"}, "FancyEnumerator#:next":{args:[], doc:"Returns the next element in the collection this enumerator is attached to.\nIt will move the internal position forward (compared to e.g. #peek, which doesn't).
\n\nExample:
\n\n a = [1,2,3]\n e = a to_enum\n e next # => 1\n e next # => 2\n e next # => 3\n e next # => raises Fancy StopIteration\n
\n\n \n\n"}, "FancyEnumerator#initialize:with:":{args:["@collection", "@iterator"], doc:"Initializes a new FancyEnumerator with a given collection
\nand iterator
selector to be used for iteration.