(function() { fancy.fdoc(true, "bakkdoor/fancy", {date:"Mon Aug 27 21:16:09 -0700 2012", title:"Fancy Documentation", classes:{"Struct":{doc:"
Structs are light-weight classes with predefined read-writable slots.
\n\n\n\n", instance_methods:{}, methods:{"new:":{doc:"Creates a new Struct class with the given slots.
\n\n \n\n", lines:[6, 25], file:"lib/struct.fy", arg:["slots"]}}, ancestors:["Struct", "Enumerable", "Object", "Kernel"]}, "Actor":{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.
\n\nExample:
\n\n a = Actor spawn: {\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 10 times: {\n a ! 'hello # send 'hello to actor asynchronously\n }\n a ! 'quit\n
\n\n\n\n", instance_methods:{}, methods:{"spawn:":{doc:"Example:
\n\n Actor spawn: {\n loop: {\n Actor receive println # print all incoming messages\n }\n }\n
\n\n \n\n", lines:[36, 50], file:"lib/rbx/actor.fy", arg:["block"]}}, ancestors:["Actor", "Object", "Kernel"]}, "Stack":{doc:"A simple Stack container class.
\n\n\n\n", instance_methods:{":initialize":{doc:"Initializes a new Stack.
\n\n\n\n", lines:[6, 12], file:"lib/stack.fy", arg:[]}, ":empty?":{doc:"Indicates, if the Stack is empty.
\n\n \n\n", lines:[62, 70], file:"lib/stack.fy", arg:[]}, ":pop":{doc:"Pops the top-of-stack element from the Stack and returns it.
\n\n \n\n", lines:[36, 44], file:"lib/stack.fy", arg:[]}, ":<<":{doc:"Pushes a value onto the Stack.
\n\n \n\n", lines:[24, 32], file:"lib/stack.fy", arg:["obj"]}, "push:":{doc:"Pushes a value onto the Stack.
\n\n \n\n", lines:[24, 32], file:"lib/stack.fy", arg:["obj"]}, "initialize:":{doc:"Initializes a new Stack with a given size.
\n\n \n\n", lines:[14, 22], file:"lib/stack.fy", arg:["size"]}, ":top":{doc:"\n\n \n\n", lines:[46, 52], file:"lib/stack.fy", arg:[]}, ":size":{doc:"\n\n \n\n", lines:[54, 60], file:"lib/stack.fy", arg:[]}, "each:":{doc:"Calls a given Block
with each element in self
, starting with the top of stack element.
Base class for integer values in Fancy.
\n\n\n\n", instance_methods:{"times:":{doc:"Calls a given Block
with each number between 0 and self
.
Similar to #times: but starts at a given offset.
\n\n \n\n", lines:[6, 18], file:"lib/integer.fy", arg:["block", "offset"]}, "times_try:retry_with:":{doc:"Tries to call a Block
self
amount of times, returning its return\nvalue or raising the last exception raised from block
after self
tries.
Example:
\n\n 2 times_try: {\n # this code will be tried 2 times.\n # if it succeeds the first time, simply return its value, otherwise try once more.\n # if it still fails after 2 attempts, raises the exception thrown (in this case probably an IOError).\n @connection readln\n } retry_with: { @connection reconnect }\n
\n\n \n\n", lines:[20, 50], file:"lib/integer.fy", arg:["block", "retry_block"]}, ":decimals":{doc:"Returns all decimals of an Integer as an Array.
\n\nExample:
\n\n 100 decimals # => [1, 0, 0]\n 12345 decimals # => [1, 2, 3, 4, 5]\n
\n\n \n\n", lines:[52, 71], file:"lib/integer.fy", arg:[]}, "times_try:":{doc:"Forward to message times_try:retry_with:
\n\n\n\n", lines:[19, 50], file:"lib/integer.fy", arg:["block"]}}, methods:{}, ancestors:["Integer", "Precision", "Numeric", "Comparable", "Object", "Kernel"]}, "IO":{doc:"Base class for IO related classes (like File
, Socket
, Console
etc.).
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", lines:[29, 93], file:"lib/fdoc.fy", arg:[]}}, ancestors:["Fancy FDoc", "Object", "Kernel"]}, "DynamicSlotObject":{doc:"Helper class to dynamically create Object
s with slots defined by sending messages to it.
Example:
\n\n dso = DynamicSlotObject new\n dso name: \"Chris\"\n dso age: 25\n dso country: \"Germany\"\n\n dso object # => Object with slots 'name, 'age and 'country defined\n
\n\n\n\n", instance_methods:{":object":{doc:"\n\n \n\n", lines:[18, 25], file:"lib/dynamic_slot_object.fy", arg:[]}}, methods:{}, ancestors:["DynamicSlotObject", "Fancy BasicObject", "Object", "Kernel"]}, "MethodMixin":{doc:"Mixin class with common methods included by Method
and UnboundMethod
.
Returns an Array of all the FancySpec SpecTests defined for a\nMethod.
\n\n\n\n", lines:[51, 59], file:"lib/rbx/method.fy", arg:[]}, "documentation:":{doc:"\n\n \n\n", lines:[14, 20], file:"lib/rbx/method.fy", arg:["docstring"]}}, methods:{}, ancestors:["MethodMixin", "Object", "Kernel"]}, "Fiber":{doc:"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", instance_methods:{"resume:":{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
.
Returns execution control to the parent Fiber
and passes along vals
.
Creates a new Fiber running block
.
Fiber
\n\n\n\n", lines:[9, 11], file:"lib/fiber.fy", arg:[]}}, ancestors:["Rubinius Fiber", "Object", "Kernel"]}, "Console":{doc:"Console class. Used for STDIO
.
Prints a given object on STDOUT
.
Prints a given object on STDOUT
, followed by a newline.
Reads a line from STDIN
and returns it as a String
.
Prints a newline to STDOUT
.
Prints a given message to STDOUT
, followed by reading a line from\nSTDIN
.
Clears the Console
.
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.
Forwards all incoming message to self
to @target
\nonly if @target
responds to them.
Initializes a new RespondsToProxy for target
.
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", instance_methods:{}, methods:{"sleep:":{doc:"Sets the Fancy process for a given amount of seconds to sleep.
\n\n\n\n", lines:[84, 88], file:"lib/rbx/thread.fy", arg:["seconds"]}}, ancestors:["Thread", "Object", "Kernel"]}, "Tuple":{doc:"Tuples are fixed-size containers providing index-based access to its\nelements.
\n\n\n\n", instance_methods:{"from:to:":{doc:"Returns sub-array starting at from: and going to to:
\n\n \n\n", lines:[54, 76], file:"lib/tuple.fy", arg:["from", "to"]}, ":[]":{doc:"Forwards to Tuple
#at:.
Sets a value for a given index within a Tuple
.
Example:
\n\n (1,2,3) reverse_each: @{print}\n # prints: 321\n
\n\n \n\n", lines:[95, 109], file:"lib/tuple.fy", arg:["block"]}, ":==":{doc:"Compares two Tuple
s with each other.
Sets a value for a given index within a Tuple
.
Calls a given Block
with each element in the Tuple
.
Returns an element at a given indes.\nPossibly throws an Rubinius
ObjectBoundsExceededError
.
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.
Creates a new Tuple
with the values
passed in.
Example:
\n\n Tuple with_values: [1,2,3] # => (1,2,3)\n
\n\n \n\n", lines:[11, 26], file:"lib/tuple.fy", arg:["values"]}, ":name":{doc:"Tuple
\n\n\n\n", lines:[42, 44], file:"lib/tuple.fy", arg:[]}}, ancestors:["Rubinius Tuple", "Fancy Enumerable", "Object", "Enumerable", "Object", "Kernel"]}, "KVO":{doc:"Key-Value Observing Mixin class.\nInclude this Class into any class to add support for Key-Value Observing.\nInspired by Objective-C's KVO, but using Block
s, as it fits nicer\nwith Fancy's semantics.
Example:
\n\n class Person {\n include: KVO\n read_write_slots: ('name, 'age, 'city)\n }\n\n tom = Person new tap: @{\n name: \"Tom Cruise\"\n age: 55\n city: \"Hollywood\"\n }\n\n tom observe: 'name with: |new old| {\n new println\n }\n tom name: \"Tommy Cruise\" # will cause \"Tommy Cruise\" to be printed\n tom age: 56 # No observer Blocks defined, so nothing will happen\n
\n\n\n\n", instance_methods:{"observe:with:":{doc:"Registers a new observer Block
for slotname
in self
.
Registers a new removal observer Block
for collection named slotname
in self
.
Registers a new insertion observer Block
for collection named slotname
in self
.
TCP Server
\n\n\n\n", instance_methods:{}, methods:{}, ancestors:["TCPServer", "Socket ListenAndAccept", "IO Socketable", "TCPSocket", "IPSocket", "BasicSocket", "IO", "IOMixin", "Object", "Unmarshalable", "File Constants", "Enumerable", "Object", "Kernel"]}, "String":{doc:"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 Fancy
Enumerable
, which means you can use all the\ncommon sequence methods on them, like Fancy
Enumerable
map:
, Fancy
Enumerable
select:
etc.
Splits a string by whitespace.
\n\n \n\n", lines:[71, 78], file:"lib/rbx/string.fy", arg:[]}, ":whitespace?":{doc:"Indicates, if a String
is empty or a single whitespace character.
Example:
\n\n \"hello world\" words # => [\"hello\", \"world\"]\n
\n\n \n\n", lines:[85, 94], file:"lib/string.fy", arg:[]}, ":bytes":{doc:"\n\n \n\n", lines:[178, 188], file:"lib/string.fy", arg:[]}, "==":{doc:"Compares self
to another String
and returns true
, if equal, false
otherwise.
Forward to message if_main:else:
\n\n\n\n", lines:[223, 234], file:"lib/string.fy", arg:["main_block"]}, ":eval_global":{doc:"Same as String#eval
but evaluates self
in the global binding.
Returns a String
containing all but the first character.
\"hello\" rest # => \"ello\"\n
\n\n \n\n", lines:[104, 113], file:"lib/string.fy", arg:[]}, ":eval":{doc:"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", lines:[125, 140], file:"lib/string.fy", arg:["object"]}, "substitute:with:":{doc:"\n\n \n\n", lines:[157, 165], file:"lib/rbx/string.fy", arg:["substring", "substitution"]}, ":lowercase":{doc:"Example:
\n\n \"HELLO WORLD\" lowercase # => \"hello world\"\n
\n\n \n\n", lines:[282, 287], file:"kernel/common/string.rb"}, "relative_path:":{doc:"Example:
\n\n __FILE__ relative: \"../foo/bar\"\n
\n\n \n\n", lines:[190, 200], file:"lib/string.fy", arg:["path"]}, ":uppercase":{doc:"Example:
\n\n \"hello world\" uppercase # => \"HELLO WORLD\"\n
\n\n \n\n", lines:[814, 819], file:"kernel/common/string.rb"}, ":downcase":{doc:"Example:
\n\n \"HELLO WORLD\" lowercase # => \"hello world\"\n
\n\n \n\n", lines:[282, 287], file:"kernel/common/string.rb"}, "split:":{doc:"\n\n \n\n", lines:[63, 69], file:"lib/rbx/string.fy", arg:["str"]}, ":main?":{doc:"\n\n \n\n", lines:[216, 222], file:"lib/string.fy", arg:[]}, ":[]":{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", lines:[18, 30], file:"lib/rbx/string.fy", arg:["index"]}, ":skip_leading_indentation":{doc:"Remove leading white space for multi-line strings.\nThis method expects the first character to be an line return.
\n\n\n\n", lines:[142, 157], file:"lib/string.fy", arg:[]}, "lowercase":{doc:"Example:
\n\n \"HELLO WORLD\" lowercase # => \"hello world\"\n
\n\n \n\n", lines:[282, 287], file:"kernel/common/string.rb"}, ":++":{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", lines:[31, 41], file:"lib/string.fy", arg:["other"]}, ":*":{doc:"Returns a String
that is the num-fold concatenation of itself.
Example:
\n\n \"foo\" * 3 # => \"foofoofoo\"\n
\n\n \n\n", lines:[67, 83], file:"lib/string.fy", arg:["num"]}, ":lines":{doc:"Returns the lines of a String
as an Array
.
Example:
\n\n \"hello world\" uppercase # => \"HELLO WORLD\"\n
\n\n \n\n", lines:[814, 819], file:"kernel/common/string.rb"}, "if_main:else:":{doc:"Same as:
\n\n if: main? then: else_block else: else_block\n
\n\n \n\n", lines:[224, 234], file:"lib/string.fy", arg:["main_block", "else_block"]}, ":characters":{doc:"\n\n \n\n", lines:[159, 165], file:"lib/string.fy", arg:[]}, "each:":{doc:"Calls a given Block
with each character in a String
.
Example:
\n\n \"foo\n
\n\nbar\" multiline? # => true
\n\n \"foo bar\" multiline? # => false\n \"\" multiline? # => false\n \"\n
\n\n\" multiline? # => true
\n\n \n\n", lines:[198, 214], file:"lib/string.fy", arg:[]}, ":character":{doc:"\n\n \n\n", lines:[167, 176], file:"lib/string.fy", arg:[]}, "upcase":{doc:"Example:
\n\n \"hello world\" uppercase # => \"HELLO WORLD\"\n
\n\n \n\n", lines:[814, 819], file:"kernel/common/string.rb"}, "includes?:":{doc:"Indicates if a given substring is in self
.
Returns a Substring from from
to to
.
Raises a new StandardError
with self as the message.
Example:
\n\n \"HELLO WORLD\" lowercase # => \"hello world\"\n
\n\n \n\n", lines:[282, 287], file:"kernel/common/string.rb"}, ":==":{doc:"Compares self
to another String
and returns true
, if equal, false
otherwise.
Appends another String
onto this String
.
Example usage:\n str = \"hello\"\n str append: \" world!\"\n str # => \"hello world!\"
\n\n \n\n", lines:[130, 144], file:"lib/rbx/string.fy", arg:["string"]}, "uppercase":{doc:"Example:
\n\n \"hello world\" uppercase # => \"HELLO WORLD\"\n
\n\n \n\n", lines:[814, 819], file:"kernel/common/string.rb"}, ":blank?":{doc:"Indicates, if a String
consists only of whitespace.
Returns the character (as a String
) at index idx
.
NilClass. The class of the singleton nil
value.
Calls else_block
.
Calls block
with self
.
Calls then_block
with self
.
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", instance_methods:{}, methods:{"create_class_references:":{doc:"Creates class references for Fancy class names.\nA docstring may contain class names sorounded by @\nwithout space between the @.
\n\nNested classes can be indicated by using :: like
\n\n Foo::Bar\n
\n\nThis will create references for both, Foo
and Bar
Instance methods should be written:
\n\n Foo::Bar#baz\n
\n\nClass methods should be written:
\n\n Foo::Bar.baz\n
\n\nSome examples:\nA simple class reference:\nFancy
Nested class reference:\nFancy
FDoc
A fancy method without arguments:\nFancy
FDoc
JSON
generate_map
A ruby method reference (will link to ruby docs if available)\nString
split
A fancy method with many arguments:\nFancy
Package
Installer
initialize:version:install_path:
A singleton method:\nFancy
FDoc
Formatter
format:
System class. Holds system-wide relevant methods.
\n\n\n\n", instance_methods:{}, methods:{"do:":{doc:"Runs the given string as a system() command.
\n\n\n\n", lines:[26, 32], file:"lib/rbx/system.fy", arg:["command_str"]}, "piperead:":{doc:"Runs the given string as a popen() call and returns the output\nof the call as a string.
\n\n\n\n", lines:[34, 41], file:"lib/rbx/system.fy", arg:["command_str"]}, "pipe:":{doc:"Runs the given string as a popen3() call and returns a IO handle\nthat can be read from
\n\n \n\n", lines:[43, 54], file:"lib/rbx/system.fy", arg:["command_str"]}, ":abort":{doc:"Exits the current running Fancy process (application) with an exit\ncode of 1 (indicating failure).
\n\n\n\n", lines:[2, 9], file:"lib/system.fy", arg:[]}, "exit:":{doc:"Exit the running Fancy process with a given exit code.
\n\n \n\n", lines:[16, 24], file:"lib/rbx/system.fy", arg:["exitcode"]}, "aborting:do:":{doc:"Prints message
on *stderr*
, calls block
and finally exits with an exit\ncode of 1 (indicating failure).
Prints message
on *stderr*
and exits with an exit code of 1 (indicating\nfailure).
Exit the running Fancy process.
\n\n\n\n", lines:[8, 14], file:"lib/rbx/system.fy", arg:[]}, "pipe:do:":{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
.
Root class of Fancy's class hierarchy.\nAll classes inherit from Object.
\n\n\n\n", instance_methods:{"receive_message:with_params:":{doc:"Dynamically sends a given message with parameters to self
.
Copies all slots from object
to self
.
Same as:\ncond_block until_do: body_block
\n\n\n\n", lines:[246, 253], file:"lib/object.fy", arg:["cond_block", "body_block"]}, "send_async:":{doc:"Forward to message send_async:with_params:
\n\n\n\n", lines:[518, 530], file:"lib/object.fy", arg:["message"]}, "if_true:":{doc:"Calls the block
(default behaviour).
Forward to message let:be:in:ensuring:
\n\n\n\n", lines:[672, 708], file:"lib/object.fy", arg:["var_name", "value"]}, "loop:":{doc:"Infinitely calls the block (loops).
\n\n \n\n", lines:[19, 27], file:"lib/object.fy", arg:["block"]}, "break:":{doc:"Returns value
from iteratioen.
Same as:\ncond_block while_do: body_block
\n\n\n\n", lines:[237, 244], file:"lib/object.fy", arg:["cond_block", "body_block"]}, ":_":{doc:"\n\n \n\n", lines:[808, 814], file:"lib/object.fy", arg:[]}, "returning:do:":{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", lines:[335, 354], file:"lib/object.fy", arg:["value", "block"]}, "do:while:":{doc:"\n\n \n\n", lines:[255, 263], file:"lib/object.fy", arg:["body_block", "cond_block"]}, "ignoring:do:":{doc:"Example:
\n\n ignoring: (IOError, ZeroDivisionError) in: {\n # do something\n }\n
\n\n \n\n", lines:[769, 783], file:"lib/object.fy", arg:["exception_classes", "block"]}, ":println":{doc:"Same as:\nstdout println: self
\n\nPrints self
on stdout
, followed by a newline.
Returns a Proxies
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", lines:[356, 369], file:"lib/object.fy", arg:[]}, "lambda:":{doc:"\n\n \n\n", lines:[140, 147], file:"lib/rbx/object.fy", arg:["block"]}, "set_slot:value:":{doc:"Sets an object's slot with a given value.
\n\n \n\n", lines:[35, 44], file:"lib/rbx/object.fy", arg:["slotname", "val"]}, ":die!":{doc:"Tells an object to let its actor to die (quit running).
\n\n\n\n", lines:[489, 495], file:"lib/object.fy", arg:[]}, "kind_of?:":{doc:"Same as Object#is_a?:\nIndicates, if an object is an instance of a given Class.
\n\n\n\n", lines:[89, 96], file:"lib/rbx/object.fy", arg:["class"]}, "send_future:":{doc:"Forward to message send_future:with_params:
\n\n\n\n", lines:[506, 517], file:"lib/object.fy", arg:["message"]}, ":||":{doc:"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 value
for current iteration and skip to the next one.
Indicates, if two objects are not equal.
\n\n \n\n", lines:[51, 60], file:"lib/object.fy", arg:["other"]}, "and:":{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.
Does nothing (default behaviour).
\n\n \n\n", lines:[86, 93], file:"lib/object.fy", arg:["block"]}, "yield:":{doc:"Same as Fiber##yield:
\n\n\n\n", lines:[405, 411], file:"lib/object.fy", arg:["values"]}, "synchronized:":{doc:"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
).
Returns the String
concatenation of self
and other
.\nCalls to_s on self
and other
and concatenates the results to a new String
.
Dynamically sends a given message (without parameters) to self
.
Indicates if an object responds to a given message.
\n\n \n\n", lines:[119, 128], file:"lib/rbx/object.fy", arg:["message"]}, "copy_slots:from:":{doc:"Copies slots from object
to self
.
Calls else_block
(default behaviour).
Sets the documentation string for an Object.
\n\n \n\n", lines:[315, 323], file:"lib/object.fy", arg:["docstring"]}, ":<>":{doc:"Shorthand for: MatchAll new: self with: other
Returns a NegativeMatcher
for self.
Breaks / Stops current iteration.
\n\n\n\n", lines:[431, 437], file:"lib/object.fy", arg:[]}, "or:":{doc:"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)
Dynamically defines a method on self's
metaclass (a singleton method) using a given Block
.
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.
Forward to message let:be:in:ensuring:
\n\n\n\n", lines:[672, 708], file:"lib/object.fy", arg:["var_name", "value", "block"]}, ":actor":{doc:"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", lines:[497, 505], file:"lib/object.fy", arg:[]}, ":is_not":{doc:"Returns a NegativeMatcher
for self.
Returns the method with a given name for self, if defined.
\n\n \n\n", lines:[296, 303], file:"lib/object.fy", arg:["method_name"]}, ":to_enum":{doc:"\n\n \n\n", lines:[150, 156], file:"lib/object.fy", arg:[]}, "do:":{doc:"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\nIf you pass it a block with 1 argument this method behaves exactly like Object
tap:
Example:
\n\n some_complex_object do: @{\n method_1: arg1\n method_2: arg2\n method_3: arg3\n }\n
\n\n \n\n", lines:[607, 641], file:"lib/object.fy", arg:["block"]}, ":nil?":{doc:"\n\n \n\n", lines:[110, 116], file:"lib/object.fy", arg:[]}, ":does":{doc:"Returns a PositiveMatcher
for self.
Opens filename
and rebinds *stdout*
to it within block
.
Example:
\n\n with_output_to: \"/tmp/hello_world.txt\" do: {\n \"hello\" println\n \"world\" println\n }\n
\n\nThis writes
\n\n hello\n world\n
\n\nto /tmp/hello_world.txt
\n\n \n\n", lines:[710, 731], file:"lib/object.fy", arg:["filename", "block"]}, "unless:then:":{doc:"Same as:\ncond if_true: { nil } else: block
\n\n\n\n", lines:[275, 282], file:"lib/object.fy", arg:["cond", "block"]}, "get_slots:":{doc:"\n\n \n\n", lines:[567, 576], file:"lib/object.fy", arg:["slots"]}, "tap:":{doc:"Calls a given Block
with self
before returning self
.
If within_block
takes an argument, it is called with self
.
Example:
\n\n class MyRebindableClass {\n def foo {\n 42\n }\n }\n\n r = MyRebindableClass new\n r rebind_method: 'foo with: { 0 } within: @{ foo } # => 0\n
\n\n \n\n", lines:[785, 806], file:"lib/object.fy", arg:["method_name", "rebind_callable", "within_block"]}, ":identity":{doc:"The identity method simply returns self.
\n\n \n\n", lines:[325, 333], file:"lib/object.fy", arg:[]}, "if:then:else:":{doc:"Same as:\ncond if_true: then_block else: else_block
\n\n\n\n", lines:[228, 235], file:"lib/object.fy", arg:["cond", "then_block", "else_block"]}, ":yield":{doc:"Same as Fiber##yield.
\n\n\n\n", lines:[397, 403], file:"lib/object.fy", arg:[]}, ":><":{doc:"Shorthand for: MatchAny new: self with: other
Calls the then_block
(default behaviour).
Extends self
with the methods in class
(by including its methods in self's
metaclass).
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", lines:[8, 15], file:"lib/rbx/object.fy", arg:["file_path"]}, ":dup":{doc:"Returns a deep clone of self using Ruby's Marshal class.
\n\n \n\n", lines:[17, 25], file:"lib/rbx/object.fy", arg:[]}, "get_slot:":{doc:"Returns the value of a slot of self
.
Dynamically rebinds var_name
as dynamic variable with value
as the value within block
.\nExceptions raised within ensure_block
are ignored.\nThose raised in block
will be reraised up the callstack.
Example:
\n\n File write: \"/tmp/output.txt\" 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", lines:[673, 708], file:"lib/object.fy", arg:["var_name", "value", "block", "ensure_block"]}, ":to_s":{doc:"\n\n \n\n", lines:[27, 33], file:"lib/rbx/object.fy", arg:[]}, ":?":{doc:"Calls #value on future
. Shortcut method.
Same as:\nstdout print: self
\n\nPrints self
on stdout
.
Creates a FutureSend
object (a Future / Promise) that will hold the value of sending message
to self
.
Undefines a singleton method of self
.
Returns a PositiveMatcher
for self.
Indicates, if an object is an instance of a given Class.
\n\n \n\n", lines:[78, 87], file:"lib/rbx/object.fy", arg:["class"]}, "backtick:":{doc:"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
.
Sends message
with params
to self
asynchronously and immediately returns nil
.
Does nothing (default behaviour).
\n\n \n\n", lines:[86, 93], file:"lib/object.fy", arg:["block"]}, "sleep:":{doc:"Sets the current Thread (in which self is running) for a given amount to sleep.
\n\n \n\n", lines:[663, 671], file:"lib/object.fy", arg:["seconds"]}, "if:then:":{doc:"Same as:\ncond if_true: block
\n\n\n\n", lines:[219, 226], file:"lib/object.fy", arg:["cond", "block"]}, ":documentation":{doc:"Returns the Fancy
Documentation
object for an Object.
Same as:\ncond if_true: else_block else: block
\n\n\n\n", lines:[284, 291], file:"lib/object.fy", arg:["cond", "block", "else_block"]}, "unless:do:":{doc:"Same as:\ncond if_true: { nil } else: block
\n\n\n\n", lines:[275, 282], file:"lib/object.fy", arg:["cond", "block"]}, ":should_not":{doc:"Returns a NegativeMatcher
for self.
Returns a PositiveMatcher
for self.
Same as:\ncond if_true: else_block else: block
\n\n\n\n", lines:[284, 291], file:"lib/object.fy", arg:["cond", "block", "else_block"]}, ":next":{doc:"Skip to the next iteration.
\n\n\n\n", lines:[413, 419], file:"lib/object.fy", arg:[]}, "if_false:else:":{doc:"Calls else_block
(default behaviour).
Instances of File represent files in the filesystem of the operating\nsystem on which Fancy is running.
\n\n\n\n", instance_methods:{"print:":{doc:"Writes a given String
to a File
.
Example:
\n\n f = File open: \"README.txt\"\n f expanded_path # => \"/path/to/README.txt\" (when run from /path/to/)\n
\n\n \n\n", lines:[141, 151], file:"lib/file.fy", arg:[]}, ":modes":{doc:"Returns the File
access modes Array
.
Writes a given argument as a String followed by a newline into the\nFile.
\n\n\n\n", lines:[128, 136], file:"lib/file.fy", arg:["x"]}, ":directory?":{doc:"Indicates, if a File
is a Directory
.
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", lines:[128, 136], file:"lib/file.fy", arg:["x"]}, "write:":{doc:"Writes a given String
to a File
.
Closes an opened File
.
Indicates, if a File
is opened.
Sets the File
access modes Array
.
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.
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", lines:[15, 39], file:"lib/rbx/file.fy", arg:["filename", "modes_arr", "block"]}, "delete:":{doc:"Deletes a File
with a given filename
.
Renames a File
on the filesystem.
Opens a File
for writing and calls block
with it.
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", lines:[52, 62], file:"lib/rbx/file.fy", arg:["filename"]}, "open:":{doc:"Forward to message open:modes:
\n\n\n\n", lines:[77, 98], file:"lib/rbx/file.fy", arg:["filename"]}, "read:with:":{doc:"Opens a File
for reading and calls block
with it.
Indicates if the File
with the given filename
exists.
Creates a new empty file with the given filename
, if it doesn't already exist.
Deletes a File
with a given filename
. If an IOError
occurs,\nit gets ignored.
Returns the appropriate String
representation of the modes_arr
.
Opens and reads the contents of a File
in binary mode and\nreturns its binary contents as a String
.
Opens a File
for appending and calls block
with it.
Opens a File
for reading and calls block
with it.
Reads a .fy source file as a config file.
\n\nExample:
\n\n # Given a file config.fy with these contents:\n {\n host: \"127.0.0.1\"\n port: 1234\n names: [\n 'foo,\n 'bar,\n 'baz\n ]\n something_else: {\n another_value: 'foo\n }\n }\n\n # It can be read like so:\n config = File read_config: \"config.fy\"\n\n # config is now:\n <[\n 'host => \"127.0.0.1\",\n 'port => 1234,\n 'names => ['foo, 'bar, 'baz],\n 'something_else: <[\n 'another_value => 'foo\n ]>\n ]>\n
\n\n \n\n", lines:[89, 126], file:"lib/file.fy", arg:["filename"]}, "absolute_path:":{doc:"\n\n \n\n", lines:[164, 171], file:"lib/rbx/file.fy", arg:["filename"]}, "directory?:":{doc:"Indicates, if a given path
refers to a Directory
.
Forward to message read:length:offset:
\n\n\n\n", lines:[63, 76], file:"lib/rbx/file.fy", arg:["filename", "length"]}, "read:length:offset:":{doc:"Reads all the contens (in ASCII mode) of a given file, length and offset\nand returns them as an Array of lines being read.
\n\n \n\n", lines:[64, 76], file:"lib/rbx/file.fy", arg:["filename", "length", "offset"]}}, ancestors:["File", "Enumerable", "IO", "IOMixin", "Object", "Unmarshalable", "File Constants", "Enumerable", "Object", "Kernel"]}, "StandardError":{doc:"StandardError. Base class of most Exception classes.
\n\n\n\n", instance_methods:{":initialize":{doc:"Creates a new Exception with an empty message.
\n\n\n\n", lines:[17, 21], file:"lib/rbx/exception.fy", arg:[]}, ":raise!":{doc:"Raises (throws) an Exception to be caught somewhere up the\ncallstack.
\n\n\n\n", lines:[33, 40], file:"lib/rbx/exception.fy", arg:[]}, "initialize:":{doc:"Creates a new Exception with a given message.
\n\n \n\n", lines:[23, 31], file:"lib/rbx/exception.fy", arg:["msg"]}}, methods:{"raise:":{doc:"Raises new Exception
with message
.
Example:
\n\n StandardError raise: \"Error!\"\n ArgumentError raise: \"Missing argument!\"\n # is the same as:\n StandardError new: \"Error!\\\342\200\235 . raise!\n ArgumentError new: \"Missing argument!\" . raise!\n
\n\n\n\n", lines:[2, 15], file:"lib/exception.fy", arg:["message"]}}, ancestors:["StandardError", "Exception", "Object", "Kernel"]}, "TCPSocket":{doc:"TCP Socket class.
\n\n\n\n", instance_methods:{"send:":{doc:"Forward to message send:flags:
\n\n\n\n", lines:[20, 23], file:"lib/rbx/tcp_socket.fy", arg:["msg"]}}, methods:{"open:port:":{doc:"Creates and opens a new TCPSocket
on server
and port
.
Number is a mixin-class for all number values (integer & floats for\nnow).
\n\n\n\n", instance_methods:{":even?":{doc:"Indicates, if a Number is even.
\n\n \n\n", lines:[170, 178], file:"lib/number.fy", arg:[]}, ":odd?":{doc:"Indicates, if a Number is odd.
\n\n \n\n", lines:[180, 188], file:"lib/number.fy", arg:[]}, "upto:do:":{doc:"Calls block
with each Number
between self
and num
.\nExpects num
to be greater or equal to self
.
Returns the square of a Number.
\n\n \n\n", lines:[116, 124], file:"lib/number.fy", arg:[]}, "downto:do:":{doc:"Calls block
with each Number
between self
and num
.\nExpects num
to be smaller or equal to self
.
Returns a random number between 0 and self
.
Returns the absolute (positive) value of a Number.
\n\n \n\n", lines:[146, 158], file:"lib/number.fy", arg:[]}, "upto:in_steps_of:do:":{doc:"Calls block
every steps
steps between self
and num
with the current Number
.\nExpects num
to be greater or equal to self
.
Returns the double value of a Number.
\n\n \n\n", lines:[126, 134], file:"lib/number.fy", arg:[]}, "upto:":{doc:"Returns an Array with Numbers starting at self
and going up to num
.\nExpects num
to be greater or equal to self
.
Calls block
every steps
steps between self
and num
with the current Number
.\nExpects num
to be smaller 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
.
Negates a Number (-1 becomes 1 and vice versa).
\n\n \n\n", lines:[160, 168], file:"lib/number.fy", arg:[]}, ":cubed":{doc:"Returns the cubed value of a Number.
\n\n \n\n", lines:[136, 144], file:"lib/number.fy", arg:[]}}, methods:{}, ancestors:["Number", "Object", "Kernel"]}, "OptionParser":{doc:"Parses command-line options from a given Array
(usually ARGV
) and\nexecutes registered handlers for options specified.
Example:
\n\n o = OptionParser new\n o with: \"--file [filename]\" doc: \"Use this file for processing\" do: |filename| {\n # do something with filename\n }\n
\n\n \n\n", lines:[53, 77], file:"lib/option_parser.fy", arg:["option_string", "doc_string", "block"]}, ":initialize":{doc:"Forward to message initialize:
\n\n\n\n", lines:[23, 51], file:"lib/option_parser.fy", arg:[]}, ":print_help_info":{doc:"Displays the --help
information on stdout
based on all options that were registered via OptionParser
with:doc:do:
.
Parses options from args
and executes registered option handlers.
Creates a new OptionParser.
\n\nExample:
\n\n o = OptionParser new: @{\n with: \"--my-option\" doc: \"Sets some option value\" do: {\n # do stuff in here...\n }\n }\n o parse: ARGV # parse options from ARGV\n
\n\n \n\n", lines:[38, 51], file:"lib/option_parser.fy", arg:["@block"]}}, methods:{}, ancestors:["OptionParser", "Object", "Kernel"]}, "FancySpec PositiveMatcher":{doc:"PositiveMatcher expects its actual value to be equal to an\nexpected value.\nIf the values are not equal, a SpecTest failure is generated.
\n\n\n\n", instance_methods:{"unknown_message:with_params:":{doc:"Forwards any other message and parameters to the object itself\nand checks the return value.
\n\n\n\n", lines:[347, 356], file:"lib/fancy_spec.fy", arg:["msg", "params"]}}, methods:{}, ancestors:["FancySpec PositiveMatcher", "Object", "Kernel"]}, "FancySpec":{doc:"The FancySpec class is used for defining FancySpec testsuites.\nHave a look at the tests/ directory to see some examples.
\n\n\n\n", instance_methods:{"it:with:when:":{doc:"Example:
\n\n it: \"should be an empty Array\" with: 'empty? when: {\n arr = [1,2,3]\n 3 times: { arr pop }\n arr empty? is: true\n }\n
\n\n \n\n", lines:[66, 93], file:"lib/fancy_spec.fy", arg:["spec_info_string", "method_name", "spec_block"]}, "after_each:":{doc:"\n\n \n\n", lines:[105, 111], file:"lib/fancy_spec.fy", arg:["block"]}, "before_each:":{doc:"\n\n \n\n", lines:[97, 103], file:"lib/fancy_spec.fy", arg:["block"]}, ":run":{doc:"Runs a FancySpec's test cases.
\n\n\n\n", lines:[113, 136], file:"lib/fancy_spec.fy", arg:[]}, "it:when:":{doc:"Example:
\n\n it: \"should be an empty Array\" when: {\n arr = [1,2,3]\n 3 times: { arr pop }\n arr empty? is: true\n }\n
\n\n \n\n", lines:[49, 64], file:"lib/fancy_spec.fy", arg:["spec_info_string", "spec_block"]}, "initialize:":{doc:"Forward to message initialize:test_obj:
\n\n\n\n", lines:[15, 16], file:"lib/fancy_spec.fy", arg:["@description"]}, "initialize:test_obj:":{doc:"\n\n \n\n", lines:[12, 16], file:"lib/fancy_spec.fy", arg:["@description", "@test_obj"]}, "it:for:when:":{doc:"Example:
\n\n it: \"should be an empty Array\" with: 'empty? when: {\n arr = [1,2,3]\n 3 times: { arr pop }\n arr empty? is: true\n }\n
\n\n \n\n", lines:[66, 93], file:"lib/fancy_spec.fy", arg:["spec_info_string", "method_name", "spec_block"]}}, methods:{"describe:for:with:":{doc:"Similar to FancySpec
describe:with:
but also taking an explicit test_obj
.
Example:
\n\n FancySpec describe: \"My cool class\" for: MyCoolClass with: {\n # test cases using it:for:when: here.\n }\n
\n\n\n\n", lines:[34, 47], file:"lib/fancy_spec.fy", arg:["description", "test_obj", "block"]}, "describe:with:":{doc:"Factory method for creating FancySpec instances.\nCalls block
with the new FancySpec instance as the receiver, then runs it.
Example:
\n\n FancySpec describe: MyTestClass with: {\n # test cases using it:for:when: here.\n }\n
\n\n\n\n", lines:[18, 32], file:"lib/fancy_spec.fy", arg:["test_obj", "block"]}}, ancestors:["FancySpec", "Object", "Kernel"]}, "Fancy NextIteration":{doc:"Raised to continue with next iteration (and stopping the current one).\nIt is rescued by Block#loop.
\n\n\n\n", instance_methods:{}, methods:{}, ancestors:["Fancy NextIteration", "StandardError", "Exception", "Object", "Kernel"]}, "FutureSend":{doc:"A FutureSend
gets created whenever an asynchronous message via the @ operator gets sent, yielding a FutureSend
.\nThey represent Futures/Promises in Fancy.
Example:
\n\n f = some_object @ some_method: some_argument\n f class # => FutureSend\n f value # => Value returned by some_method, but may block the current Thread if f hasn't completed yet.\n
\n\n\n\n", instance_methods:{":completed?":{doc:"\n\n \n\n", lines:[60, 70], file:"lib/future.fy", arg:[]}, "when_done:":{doc:"Registers block
as a continuation to be called with self's
value on success.
Forward to message initialize:receiver:message:with_params:
\n\n\n\n", lines:[20, 21], file:"lib/future.fy", arg:["@actor", "@receiver", "@message"]}, ":failure":{doc:"Returns the Exception
that caused self
to fail, or nil
, if it didn't fail.\nWill block the calling Thread
if self
hasn't completed or failed yet.
Registers block
as a continuation to be called with self's
value on success.
Registers block
as a continuation to be called with self's
fail reason in case of failure.
Returns the value returned by performing self
.\nWill block the calling Thread
if self
hasn't completed or failed yet.
Class for large integer values in Fancy.
\n\n\n\n", instance_methods:{}, methods:{}, ancestors:["Bignum", "Number", "Object", "Integer", "Precision", "Numeric", "Comparable", "Object", "Kernel"]}, "FancySpec NegativeMatcher":{doc:"NegativeMatcher expects its actual value to be unequal to an\nexpected value.\nIf the values are equal, a SpecTest failure is generated.
\n\n\n\n", instance_methods:{"unknown_message:with_params:":{doc:"Forwards any other message and parameters to the object itself\nand checks the return value.
\n\n\n\n", lines:[399, 408], file:"lib/fancy_spec.fy", arg:["msg", "params"]}}, methods:{}, ancestors:["FancySpec NegativeMatcher", "Object", "Kernel"]}, "DynamicKeyHash":{doc:"Helper class to dynamically create Hash
es with keys and values defined by sending messages to it.
Example:
\n\n dkh = DynamicKeyHash new\n dkh name: \"Chris\"\n dkh age: 25\n dkh country: \"Germany\"\n\n dkh hash # => <['name => \"Chris\", 'age => 25, 'country => \"Germany\"]>\n
\n\n\n\n", instance_methods:{":initialize":{doc:"Forward to message initialize:
\n\n\n\n", lines:[46, 53], file:"lib/dynamic_slot_object.fy", arg:[]}, ":hash":{doc:"\n\n \n\n", lines:[55, 61], file:"lib/dynamic_slot_object.fy", arg:[]}, "initialize:":{doc:"\n\n \n\n", lines:[50, 53], file:"lib/dynamic_slot_object.fy", arg:["@deep"]}}, methods:{}, ancestors:["DynamicKeyHash", "Fancy BasicObject", "Object", "Kernel"]}, "Fancy StopIteration":{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", instance_methods:{":result":{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", lines:[59, 83], file:"lib/iteration.fy", arg:[]}}, methods:{}, ancestors:["Fancy StopIteration", "StandardError", "Exception", "Object", "Kernel"]}, "Proxies ActorProxy":{doc:"An ActorProxy is a Proxy that forwards any message sent to it to\nit's target
object as a future send by default. If explicitly sent\nan async message, it will forward the async send to target
,\nreturning nil
instead of a FutureSend
, as expected.
Example:
\n\n ap = ActorProxy new: target_actor\n\n # this:\n f = ap some_future_send: an_arg\n # is the same as:\n f = target_actor @ some_future_send: an_arg\n\n # and this:\n ap @@ some_async_send: another_arg\n # is the same as:\n target_actor @@ some_async_send: another_arg\n
\n\n\n\n", instance_methods:{}, methods:{}, ancestors:["Proxies ActorProxy", "Fancy BasicObject", "Object", "Kernel"]}, "Method":{doc:"An instance of Method represents a method on a Class.\nEvery method in Fancy is an instance of the Method class.
\n\n\n\n", instance_methods:{":call":{doc:"Forward to message call:
\n\n\n\n", lines:[78, 81], file:"lib/rbx/method.fy", arg:[]}}, methods:{}, ancestors:["Method", "MethodMixin", "Object", "Unmarshalable", "Object", "Kernel"]}, "Exception":{doc:"Base Exception class.\nAll Exception classes inherit from Exception
.
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.
Forwards all incoming messages to self
to @proxy
and then @obj
.
Initializes a new ProxyReceiver with proxy
for obj
.
Instances of Directory
represent directories in the filesystem of\nthe operating system, in which Fancy is being run.
Creates a new Directory
on the filesystem, ignoring any\nExceptions that might occur.\nBasically works like running mkdir -p
on the shell.
Deletes a directory with a given name, if it's empty.
\n\n \n\n", lines:[38, 50], file:"lib/rbx/directory.fy", arg:["dirname"]}, "list:":{doc:"Example:
\n\n Directory list: \"tests/**/*.fy\" # => [\"tests/file1.fy\", \"tests/more/file2.fy\"]\n
\n\n \n\n", lines:[52, 68], file:"lib/rbx/directory.fy", arg:["pattern"]}, "create:":{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", lines:[7, 16], file:"lib/directory.fy", arg:["dirname"]}}, ancestors:["Dir", "Enumerable", "Object", "Kernel"]}, "Date":{doc:"Date class. Used for timely stuff.
\n\n\n\n", instance_methods:{":!=":{doc:"\n\n \n\n", lines:[14, 21], file:"lib/rbx/date.fy", arg:["other"]}}, methods:{}, ancestors:["Date", "Comparable", "Object", "Kernel"]}, "Float":{doc:"Standard class for floating point number values in Fancy.
\n\n\n\n", instance_methods:{}, methods:{}, ancestors:["Float", "Number", "Object", "Precision", "Numeric", "Comparable", "Object", "Kernel"]}, "Regexp":{doc:"Regular Expression class. Used by Regexp literals in Fancy.
\n\n\n\n", instance_methods:{}, methods:{}, ancestors:["Regexp", "Object", "Kernel"]}, "Block":{doc:"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", instance_methods:{":to_proc":{doc:"Turns a Block
into a Ruby Proc object.
Creates and returns a new Object
with slots defined dynamically in self
.\nLooks and feels similar to Javascript object literals.
Example:
\n\n o = {\n something: \"foo bar baz\"\n with: 42\n } to_object\n\n o something # => \"foo bar baz\"\n o with # => 42\n
\n\n\n\n", lines:[139, 156], file:"lib/block.fy", arg:[]}, ":[]":{doc:"Same as Block#call:
\n\n\n\n", lines:[131, 137], file:"lib/block.fy", arg:["args"]}, "if:":{doc:"Calls self
if obj
is true-ish.
Returns the receiver of the Block
(value for self
)
Calls self
while block
yields nil
or false
.
Calls block
while calling self
yields a true-ish
value.
Sets the receiver (value for self
) of a Block
.
Creates and returns a new Array
with values defined dynamically in self
.\nSimilar to Block
to_hash
but returning an Array
instead of a Hash
Example:
\n\n a = {\n something: \"foo bar baz\"\n with: 42\n something; else\n } to_a # => [['something, \"foo bar baz\"], ['with, 42], 'something, 'else]\n
\n\n\n\n", lines:[191, 205], file:"lib/block.fy", arg:[]}, "while_do:":{doc:"Calls block
while calling self
yields a true-ish
value.
Runs self
iteration
times.\nSame as: iterations times: self
Example:
\n\n { \"Hello, World\" println } * 2\n # => prints \"Hello, World\" 2 times\n
\n\n \n\n", lines:[207, 220], file:"lib/block.fy", arg:["iterations"]}, "while_nil:":{doc:"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", lines:[17, 30], file:"lib/block.fy", arg:["block"]}, "call:with_receiver:":{doc:"Same as call_with_receiver:
but passing along arguments to the Block
.
Example:
\n\n r1 = [1,2,3]\n r2 = \"hello world\"\n b = |arg| { self to_s + arg }\n b call: [\"foo\"] with_receiver: r1 # => \"123foo\"\n b call: [\"foo\"] with_receiver: r2 # => \"hello worldfoo\"\n
\n\n \n\n", lines:[67, 87], file:"lib/rbx/block.fy", arg:["args", "receiver"]}, ":===":{doc:"Matches a Block
against another object by calling self
with val
.
Opposite of Block#if:. Calls self
if obj
is false-ish.
Calls a Block
with receiver
as the receiver (referenced by self
within the Block).
Example:
\n\n r1 = [1,2,3]\n r2 = \"hello world\"\n b = { self class }\n b call_with_receiver: r1 # => Array\n b call_with_receiver: r2 # => String\n
\n\n \n\n", lines:[50, 65], file:"lib/rbx/block.fy", arg:["receiver"]}, ":&&":{doc:"Short-circuiting && (boolean AND).
\n\n\n\n", lines:[72, 80], file:"lib/block.fy", arg:["other_block"]}, ":to_hash_deep":{doc:"Creates and returns a new Hash
with keys and values defined dynamically in self
.\nSimilar to Block
to_hash
but converting any value that's a Block
to a Hash
as well.
Example:
\n\n o = {\n something: \"foo bar baz\"\n with: 42\n and: {\n another: 'field\n }\n } to_hash_deep # => <['something => \"foo bar baz\", 'with => 42, 'and => <['another => 'field]>]>\n
\n\n\n\n", lines:[173, 189], file:"lib/block.fy", arg:[]}, "while_false:":{doc:"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", lines:[17, 30], file:"lib/block.fy", arg:["block"]}, "until_do:":{doc:"Calls a given Block as long as self
yields nil
or false
.
Creates and returns a new Hash
with keys and values defined dynamically in self
.\nSimilar to Block
object
but returning a Hash
instead of an Object
Example:
\n\n o = {\n something: \"foo bar baz\"\n with: 42\n } to_hash # => <['something => \"foo bar baz\", 'with => 42]>\n
\n\n\n\n", lines:[158, 171], file:"lib/block.fy", arg:[]}, ":||":{doc:"Short-circuiting || (boolean OR).
\n\n\n\n", lines:[82, 90], file:"lib/block.fy", arg:["other_block"]}}, methods:{":name":{doc:"Block
\n\n\n\n", lines:[127, 129], file:"lib/block.fy", arg:[]}}, ancestors:["Rubinius BlockEnvironment", "Object", "Kernel"]}, "Symbol":{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", instance_methods:{"call:":{doc:"This allows Symbols to be used like Blocks (e.g. in all methods of Enumerable).
\n\nExample:
\n\n [1, 2, 3] map: 'squared # => [1, 4, 9]\n
\n\n \n\n", lines:[9, 25], file:"lib/symbol.fy", arg:["arg"]}, ":call":{doc:"Sends self
as message to the sender in its context.
Example:
\n\n 'foo call\n # => same as\n self foo\n\n if: x then: 'foo else: 'bar\n # same as:\n if: x then: { self foo } else: { self bar }\n
\n\n\n\n", lines:[27, 46], file:"lib/symbol.fy", arg:[]}, ":defined?":{doc:"Indicates if a Symbol is defined as a constant in the senders scope.
\n\n \n\n", lines:[13, 25], file:"lib/rbx/symbol.fy", arg:[]}}, methods:{}, ancestors:["Symbol", "ImmediateValue", "Object", "Kernel"]}, "Class":{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 ruby_alias methods for any unary ruby methods of a class.
\n\n\n\n", lines:[210, 222], file:"lib/rbx/class.fy", arg:[]}, "define_slot_writer:":{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", lines:[133, 147], file:"lib/class.fy", arg:["slotname"]}, "define_class_method:with:":{doc:"Defines a class method on a Class
(a singleton method) with a\ngiven name and body.
Creates a new instance of self
calling initialize:
.
Forward to message expose_to_ruby:as:
\n\n\n\n", lines:[241, 267], file:"lib/rbx/class.fy", arg:["method_name"]}, "provides_interface:":{doc:"Example:
\n\n class MyCollection {\n # you can skip this if you actually define each: before you include Fancy Enumerable.\n provides_interface: ['each]\n includes: Fancy Enumerable\n }\n
\n\n \n\n", lines:[38, 51], file:"lib/contracts.fy", arg:["methods"]}, "define_slot_reader:":{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", lines:[117, 131], file:"lib/class.fy", arg:["slotname"]}, "instance_method:":{doc:"Returns an instance method for a Class
with a given name.
Defines slot reader methods for all given slotnames.
\n\n \n\n", lines:[149, 159], file:"lib/class.fy", arg:["slots"]}, "expose_to_ruby:as:":{doc:"Explicitly exposes a Fancy method to Ruby. If ruby_method_name
is\npassed, use that name explicitly, otherwise uses method_name
.
Example:
\n\n class Foo {\n def === other {\n # ...\n }\n\n expose_to_ruby: '===\n\n # if you don't want to expose it as :=== in Ruby:\n expose_to_ruby: '=== as: 'some_other_name_for_ruby\n }\n
\n\n \n\n", lines:[242, 267], file:"lib/rbx/class.fy", arg:["method_name", "ruby_method_name"]}, "__public__:":{doc:"Sets any given method names to public on this Class
.
Forward to message methods:
\n\n\n\n", lines:[200, 208], file:"lib/rbx/class.fy", arg:[]}, ":fancy_instance_methods":{doc:"\n\n \n\n", lines:[343, 349], file:"lib/class.fy", arg:[]}, "__private__:":{doc:"Sets any given method names to private on this Class
.
Example:
\n\n class Foo {\n def foo { 'foo println }\n def bar { 'bar println }\n def baz { 'baz println }\n\n define_calling_chain: ['foo, 'bar, 'baz] for_method: 'foo\n }\n\n Foo new foo\n # prints:\n # foo\n # bar\n # baz\n\n # You can also pass in Blocks:\n Foo define_calling_chain: [@{ foo }, @{ bar }, @{ baz }] for_method: 'bar\n\n Foo new bar\n # prints:\n # foo\n # bar\n # baz\n
\n\n \n\n", lines:[442, 511], file:"lib/class.fy", arg:["blocks_or_method_names", "method_name"]}, "alias_method:for:":{doc:"Defines an alias method for another method.
\n\n \n\n", lines:[269, 278], file:"lib/class.fy", arg:["new_method_name", "old_method_name"]}, "alias_method:for_ruby:":{doc:"Creates a method alias for a Ruby method.
\n\n\n\n", lines:[149, 154], file:"lib/rbx/class.fy", arg:["new_method_name", "ruby_method_name"]}, "public:":{doc:"Sets any given method names to public on this Class
.
Example:
\n\n class MyClass {\n def foo {}\n def bar {}\n\n public: 'foo\n public: 'bar\n\n # same as:\n public: ('foo, 'bar)\n\n # same as:\n public: {\n def foo {}\n def bar {}\n }\n }\n
\n\n \n\n", lines:[83, 115], file:"lib/class.fy", arg:["public_methods"]}, "included:":{doc:"Default include hook. Make sure to call this via super included: class
.
Defines slot writer methods for all given slotnames.
\n\n \n\n", lines:[171, 181], file:"lib/class.fy", arg:["slots"]}, "private:":{doc:"Sets any given method names to private on this Class
.
Example:
\n\n class MyClass {\n def foo {}\n def bar {}\n\n private: 'foo\n private: 'bar\n\n # same as:\n private: ('foo, 'bar)\n\n # same as:\n private: {\n def foo {}\n def bar {}\n }\n }\n
\n\n \n\n", lines:[15, 47], file:"lib/class.fy", arg:["private_methods"]}, "write_slot:":{doc:"Defines a slot writer method for a given slotname.
\n\n \n\n", lines:[183, 191], file:"lib/class.fy", arg:["slotname"]}, "initialize:":{doc:"Initializes a Class
with a superclass.
Runs / Calls block_or_method
everytime before running method_name
.
Example:
\n\n Array before_method: 'inspect run: 'compact!\n [1, nil, 2, nil, 3] inspect # => \"[1, 2, 3]\"\n\n # Or pass a Block:\n Array before_method: 'inspect run: @{ compact! }\n
\n\n \n\n", lines:[369, 385], file:"lib/class.fy", arg:["method_name", "block_or_method_name"]}, "methods:":{doc:"\n\n \n\n", lines:[201, 208], file:"lib/rbx/class.fy", arg:["include_superclasses?"]}, "read_slot:":{doc:"Defines a slot reader method for a given slotname.
\n\n \n\n", lines:[161, 169], file:"lib/class.fy", arg:["slotname"]}, "protected:":{doc:"Sets any given method names to protected on this Class
.
Example:
\n\n class MyClass {\n def foo {}\n def bar {}\n\n protected: 'foo\n protected: 'bar\n\n # same as:\n protected: ('foo, 'bar)\n\n # same as:\n protected: {\n def foo {}\n def bar {}\n }\n }\n
\n\n \n\n", lines:[49, 81], file:"lib/class.fy", arg:["protected_methods"]}, "class_eval:":{doc:"Evaluates a given String
of Fancy code or a Block
in the class context of self
.\nUseful for dynamically defining methods on a class etc.
Example:
\n\n Array class_eval: \"def foo { 'foo println }\"\n [1,2,3] foo # => prints 'foo\n
\n\n \n\n", lines:[224, 240], file:"lib/rbx/class.fy", arg:["str_or_block"]}, "read_write_slots:":{doc:"Defines slot reader & writer methods for all given slotnames.
\n\n \n\n", lines:[193, 204], file:"lib/class.fy", arg:["slots"]}, "delegate:to_slot:":{doc:"Example:
\n\n class MyClass {\n delegate: ('to_s, 'inspect) to_slot: 'my_slot\n def initialize: @my_slot\n }\n\n m = MyClass new: [1, 2, 3]\n m to_s # => \"123\"\n m inspect # => \"[1, 2, 3]\"\n
\n\n \n\n", lines:[280, 325], file:"lib/class.fy", arg:["methods", "slotname"]}, "__protected__:":{doc:"Sets any given method names to protected on this Class
.
Defines an instance method on a Class
with a given name and\nbody.
Runs / Calls block_or_method_name
everytime after running method_name
.
Example:
\n\n Array after_method: 'inspect run: 'compact!\n x = [1, nil, 2, nil, 3]\n x inspect # => \"[1, nil, 2, nil, 3]\"\n x inspect # => \"[1, 2, 3]\"\n\n # Or pass a Block:\n Array after_method: 'inspect run: @{ compact! }\n
\n\n \n\n", lines:[387, 405], file:"lib/class.fy", arg:["method_name", "block_or_method_name"]}, ":nested_classes":{doc:"Returns all the nested classes within a Class
as an Array
.
Creates a new Class
with self
as superclass and the given body.
Runs / Calls block_or_method_name
everytime before & after running method_name
.
Example:
\n\n class MyController {\n def do_stuff {\n \"Doing stuff\" println\n }\n\n def log_data {\n \"Log data\" println\n }\n\n around_method: 'do_stuff run: 'log_data\n }\n\n controller = MyController new\n controller do_stuff\n\n # which will print:\n # Log data\n # Doing stuff\n # Log data\n\n # Or pass a Block:\n MyController around_method: 'do_stuff run: { \"Log data\" println }\n
\n\n \n\n", lines:[407, 440], file:"lib/class.fy", arg:["method_name", "block_or_method_name"]}, ":initialize":{doc:"Initializes a Class
with Object
set as superclass (default superclass).
Declares a required interface (collection of method signatures) an including class has to provide.
\n\nExample:
\n\n class Enumerable {\n expects_interface_on_inclusion: ['each:]\n }\n
\n\n \n\n", lines:[21, 34], file:"lib/contracts.fy", arg:["methods"]}, "instance_methods:":{doc:"\n\n \n\n", lines:[192, 199], file:"lib/rbx/class.fy", arg:["include_superclasses?"]}, "undefine_class_method:":{doc:"Undefines a class method on a Class
with a given name.
Example:
\n\n Fixnum inspect # => \"Fixnum : Integer\"\n Object inspect # => \"Object\"\n
\n\n \n\n", lines:[327, 341], file:"lib/class.fy", arg:[]}, "subclass?:":{doc:"Indicates, if a Class is a subclass of another Class.
\n\n \n\n", lines:[251, 267], file:"lib/class.fy", arg:["class_obj"]}, "remove_slot_accessors_for:":{doc:"Removes both reader and writer methods for slots in slotnames
.
Defines slot reader & writer methods for a given slotname.
\n\n \n\n", lines:[206, 215], file:"lib/class.fy", arg:["slotname"]}, "alias_method_rbx:for:":{doc:"Rbx specific version of alias_method:for: due to bootstrap order\nreasons. Should not be used directly.
\n\n\n\n", lines:[140, 147], file:"lib/rbx/class.fy", arg:["new_method_name", "old_method_name"]}, "missing_methods_for_interface:":{doc:"\n\n \n\n", lines:[63, 71], file:"lib/contracts.fy", arg:["methods"]}, ":ruby_instance_methods":{doc:"\n\n \n\n", lines:[351, 357], file:"lib/class.fy", arg:[]}, "undefine_method:":{doc:"Undefines an instance method on a Class with a given name.
\n\n \n\n", lines:[72, 80], file:"lib/rbx/class.fy", arg:["name"]}, ":new":{doc:"Creates a new instance of self
calling initialize
.
Declares a required interface (collection of method signatures) an including class has to provide.
\n\nExample:
\n\n class Enumerable {\n expects_interface_on_inclusion: ['each:]\n }\n
\n\n \n\n", lines:[21, 34], file:"lib/contracts.fy", arg:["methods"]}, "rebind_instance_method:with:within:":{doc:"Forward to message rebind_instance_method:with:within:receiver:
\n\n\n\n", lines:[535, 567], file:"lib/class.fy", arg:["method_name", "rebind_callable", "within_block"]}, "provides_interface?:":{doc:"\n\n \n\n", lines:[53, 61], file:"lib/contracts.fy", arg:["methods"]}, "rebind_instance_method:with:within:receiver:":{doc:"Rebinds method_name
to rebind_callable
within within_block
.\nIf within_block
takes an argument, it will be called with receiver
(defaults to self
).
Defines a lazy getter for slotname
that yields the result of calling block
and caches it in slotname
.
Forward to message instance_methods:
\n\n\n\n", lines:[191, 199], file:"lib/rbx/class.fy", arg:[]}}, methods:{"superclass:body:":{doc:"Creates a new Class
by subclassing superclass
and\nusing body_block
as its body.
Time class. Used for even more timely stuff.
\n\n\n\n", instance_methods:{}, methods:{}, ancestors:["Time", "Comparable", "Object", "Kernel"]}, "Proxies DistributingProxy":{doc:"DistributingProxy is a Proxy that round-robin distributes messages to objects\nin a Fancy
Enumerable
specified upon creation.
Example:
\n\n p = DistributingProxy new: [worker1, worker2, worker3, worker4]\n loop: {\n req = @input receive_request\n p handle_request: req # will be forwarded to worker1-4\n }\n
\n\n\n\n", instance_methods:{}, methods:{}, ancestors:["Proxies DistributingProxy", "Fancy BasicObject", "Object", "Kernel"]}, "Array":{doc:"Array class.\nArrays are dynamically resizable containers with a constant-time\nindex-based access to members.
\n\n\n\n", instance_methods:{"remove_if:":{doc:"Like Array
remove:
, but taking a condition Block
.\nRemoves all elements that meet the given condition Block
.
Inserts a given object at a given index (position) in the Array.
\n\n \n\n", lines:[76, 86], file:"lib/rbx/array.fy", arg:["idx", "obj"]}, "select_with_index:":{doc:"Same as #select:, just gets also called with an additional argument\nfor each element's index value.
\n\n\n\n", lines:[392, 405], file:"lib/array.fy", arg:["block"]}, "reverse_each:":{doc:"Example:
\n\n [1,2,3] reverse_each: @{print}\n # prints: 321\n
\n\n \n\n", lines:[115, 129], file:"lib/array.fy", arg:["block"]}, "reject!:":{doc:"Same as Array#reject: but doing so in-place (destructive).
\n\n\n\n", lines:[220, 227], file:"lib/array.fy", arg:["block"]}, ":compact!":{doc:"Removes all nil-value elements in place.
\n\n \n\n", lines:[229, 238], file:"lib/array.fy", arg:[]}, "index:":{doc:"Returns the index of an item (or nil, if it isn't in the Array
).\nIf item
is a Block
, it will return the index of an element for which it yields true
.
Prints each element on a seperate line.
\n\n\n\n", lines:[264, 273], file:"lib/array.fy", arg:[]}, ":rest":{doc:"Returns all elements except the first one as a new Array
.
Returns a pretty-printed String
representation of self
.\nExample:
[1, 'foo, \"bar\", 42] inspect # => \"[1, 'foo, \\\"bar\\\", 42]\"\n
\n\n \n\n", lines:[275, 291], file:"lib/array.fy", arg:[]}, ":>>":{doc:"Returns new Array with elements of other_arr appended to these.
\n\n \n\n", lines:[196, 206], file:"lib/array.fy", arg:["other_arr"]}, ":indices":{doc:"Returns an Array
of all the indices of an Array
.
[1,2,3] indices # => [0,1,2]\n
\n\n \n\n", lines:[342, 351], file:"lib/array.fy", arg:[]}, ":to_hash":{doc:"Returns a Hash
with each key-value pair in self
.
Example:
\n\n [[1,2],[3,4]] to_hash # => <[1 => 2, 3 => 4]>\n
\n\n\n\n", lines:[407, 421], file:"lib/array.fy", arg:[]}, "values_at:":{doc:"Returns new Array
with elements at given indices.
Like find: but takes a block that gets called with each element to find it.
\n\n \n\n", lines:[165, 179], file:"lib/array.fy", arg:["block"]}, ":[]":{doc:"Given an Fancy
Enumerable
of 2 Fixnum
s, it returns the sub-array between the given indices.\nIf given a single Fixnum
, returns the element at that index.
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", lines:[53, 70], file:"lib/array.fy", arg:["arr"]}, ":to_a":{doc:"\n\n \n\n", lines:[293, 299], file:"lib/array.fy", arg:[]}, "select!:":{doc:"Removes all elements in place, that don't meet the condition.
\n\n \n\n", lines:[208, 218], file:"lib/array.fy", arg:["condition"]}, "remove:":{doc:"Removes all occurances of obj in the Array.
\n\n \n\n", lines:[240, 249], file:"lib/array.fy", arg:["obj"]}, "unshift:":{doc:"Inserts a value at the front of self
.
Example:
\n\n a = [1,2,3]\n a unshift: 10\n a # => [10,1,2,3]\n
\n\n \n\n", lines:[142, 156], file:"lib/rbx/array.fy", arg:["value"]}, ":*":{doc:"Returns a new Array
that contains the elements of self num times\nin a row.
Calls a given Block
with each element in the Array
.
Returns the item, if it's in the Array or nil (if not found).
\n\n \n\n", lines:[148, 163], file:"lib/array.fy", arg:["item"]}, ":join":{doc:"Joins all elements with the empty String
.
Example:
\n\n [\"hello\", \"world\", \"!\"] join # => \"hello,world!\"\n
\n\n \n\n", lines:[129, 140], file:"lib/rbx/array.fy", arg:[]}, "includes?:":{doc:"Indicates, if an Array includes a given value.
\n\n \n\n", lines:[28, 37], file:"lib/rbx/array.fy", arg:["obj"]}, "join:":{doc:"Joins all elements in the Array with a given String
.
Example:
\n\n [1,2,3] join: \", \\\342\200\235 # => \\\342\200\2351, 2, 3\"\n
\n\n \n\n", lines:[115, 127], file:"lib/rbx/array.fy", arg:["join_str"]}, "from:to:":{doc:"Returns sub-array starting at from: and going to to:
\n\n \n\n", lines:[371, 390], file:"lib/array.fy", arg:["from", "to"]}, "indices_of:":{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", lines:[353, 369], file:"lib/array.fy", arg:["item"]}, "remove_at:":{doc:"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", lines:[39, 61], file:"lib/rbx/array.fy", arg:["index"]}, ":-":{doc:"Returns an Array
of all values in self
that are not in other
.
Example:
\n\n [1,2,3,4] - [2,4,5] # => [1,3]\n
\n\n \n\n", lines:[328, 340], file:"lib/array.fy", arg:["other"]}, "at:put:":{doc:"Inserts a given object at a given index (position) in the Array.
\n\n \n\n", lines:[76, 86], file:"lib/rbx/array.fy", arg:["idx", "obj"]}, "last:":{doc:"Returns new Array with last n elements specified.
\n\n \n\n", lines:[105, 113], file:"lib/rbx/array.fy", arg:["count"]}, ":+":{doc:"Returns concatenation with another Fancy
Enumerable
.
Example:
\n\n [1,2,3] + [3,4,5] # => [1,2,3,3,4,5]\n
\n\n \n\n", lines:[314, 326], file:"lib/array.fy", arg:["other"]}, ":clone":{doc:"Clones (shallow copy) the Array
.
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", lines:[34, 51], file:"lib/array.fy", arg:["arr"]}, ":=?":{doc:"Compares two Arrays where order does not matter.
\n\n \n\n", lines:[131, 146], file:"lib/array.fy", arg:["other"]}, "at:":{doc:"Returns the element in the Array
at a given index.
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.\nIf default
is a Block
, call it with each index instead and\nstore the return value.
Example:
\n\n Array new: 3 with: 'hello # => ['hello, 'hello, 'hello]\n # default can also be a block, taking the current index.\n Array new: 3 with: @{ * 2 } # => [0, 2, 4]\n
\n\n \n\n", lines:[6, 26], file:"lib/rbx/array.fy", arg:["size", "default"]}}, ancestors:["Array", "Fancy Enumerable", "Object", "Enumerable", "Object", "Kernel"]}, "Set":{doc:"A simple Set data structure class.
\n\n\n\n", instance_methods:{":[]":{doc:"Indicates, if the Set includes value
.
Removes a given object from a Set, if available.
\n\n \n\n", lines:[143, 151], file:"lib/set.fy", arg:["obj"]}, ":values":{doc:"\n\n \n\n", lines:[29, 35], file:"lib/set.fy", arg:[]}, "initialize:":{doc:"Initialize a new Set with a given collection of values.
\n\n \n\n", lines:[8, 19], file:"lib/set.fy", arg:["values"]}, ":&":{doc:"\n\n \n\n", lines:[175, 186], file:"lib/set.fy", arg:["other"]}, "each:":{doc:"Calls a given Block for each element of the Set.
\n\n \n\n", lines:[115, 125], file:"lib/set.fy", arg:["block"]}, "includes?:":{doc:"Indicates, if the Set includes value
.
Initialize a new empty Set.
\n\n\n\n", lines:[21, 27], file:"lib/set.fy", arg:[]}, ":-":{doc:"\n\n \n\n", lines:[162, 173], file:"lib/set.fy", arg:["other"]}, ":==":{doc:"Indicates, if two Sets are equal.
\n\n \n\n", lines:[55, 69], file:"lib/set.fy", arg:["other"]}, ":empty?":{doc:"Indicates, if a Set is empty.
\n\n \n\n", lines:[45, 53], file:"lib/set.fy", arg:[]}, ":+":{doc:"\n\n \n\n", lines:[153, 160], file:"lib/set.fy", arg:["other"]}, ":<<":{doc:"Insert a value into the Set.
\n\n \n\n", lines:[81, 91], file:"lib/set.fy", arg:["value"]}, ":size":{doc:"\n\n \n\n", lines:[37, 43], file:"lib/set.fy", arg:[]}, ":to_s":{doc:"Returns a String
representation of a Set.
Returns a detailed String
representation of a Set.
Initialize a new Set with a given collection of values.
\n\n \n\n", lines:[71, 79], file:"lib/set.fy", arg:["values"]}}, ancestors:["Set", "Fancy Enumerable", "Object", "Object", "Kernel"]}, "Fancy MessageSink":{doc:"A MessageSink just swallows all messages that are sent to it.
\n\n\n\n", instance_methods:{"unknown_message:with_params:":{doc:"m
Message sent to self
.\np
Array
of parameters sent along with m
.
Catches all messages and arguments and simply always returns self
.
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", instance_methods:{}, methods:{}, ancestors:["Fancy BreakIteration", "StandardError", "Exception", "Object", "Kernel"]}, "FancySpec SpecTest":{doc:"FancySpec test case class.
\n\n\n\n", instance_methods:{"failed:":{doc:"Forward to message failed:location:
\n\n\n\n", lines:[244, 251], file:"lib/fancy_spec.fy", arg:["actual_and_expected"]}}, methods:{"failed_test:":{doc:"Gets called when a SpecTest failed.
\n\n \n\n", lines:[157, 167], file:"lib/fancy_spec.fy", arg:["test"]}, "failed_negative_test:":{doc:"Gets called when a negative SpecTest (using NegativeMatcher
) failed.
Mixin-Class with useful methods for collections that implement an each:
method.
Example:
\n\n [1,2,3,4,5] drop: 2 # => [3,4,5]\n
\n\n \n\n", lines:[390, 404], file:"lib/enumerable.fy", arg:["amount"]}, "reduce:init_val:":{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", lines:[408, 422], file:"lib/enumerable.fy", arg:["block", "init_val"]}, "reverse_each:":{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 (1,2,3,4) first: 2 # => [1,2]\n
\n\n \n\n", lines:[91, 105], file:"lib/enumerable.fy", arg:["amount"]}, "grep:":{doc:"Example:
\n\n \"hello world\" grep: /[a-h]/ # => [\"h\", \"e\", \"d\"]\n [\"hello\", \"world\", 1, 2, 3] grep: String # => [\"hello\", \"world\"]\n
\n\n \n\n", lines:[771, 782], file:"lib/enumerable.fy", arg:["pattern"]}, ":random":{doc:"\n\n \n\n", lines:[596, 602], file:"lib/enumerable.fy", arg:[]}, ":rest":{doc:"\n\n \n\n", lines:[83, 89], file:"lib/enumerable.fy", arg:[]}, "reject:":{doc:"Similar to select:
but inverse.\nReturns a new Array
with all elements that don't meet the given condition block.
Returns the maximum value in the Enumerable (via the '>' comparison message).
\n\n \n\n", lines:[524, 532], file:"lib/enumerable.fy", arg:[]}, "all?:":{doc:"Takes condition-block and returns true
if all elements meet it.
Similar to find:
but takes a block that is called for each element to find it.
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.
Example:
\n\n [1,2,3,4,5] drop: 2 # => [3,4,5]\n
\n\n \n\n", lines:[390, 404], file:"lib/enumerable.fy", arg:["amount"]}, ":unique":{doc:"Returns a new Array with all unique values (double entries are skipped).
\n\nExample:
\n\n [1,2,1,2,3] unique # => [1,2,3]\n
\n\n \n\n", lines:[436, 453], file:"lib/enumerable.fy", arg:[]}, "split_at:":{doc:"Example:
\n\n [1,2,3,4,5] split_at: 2 # => [[1,2], [3,4,5]]\n
\n\n \n\n", lines:[747, 757], file:"lib/enumerable.fy", arg:["index"]}, "includes?:":{doc:"Indicates, if a collection includes a given element.
\n\n \n\n", lines:[124, 133], file:"lib/enumerable.fy", arg:["item"]}, "join:":{doc:"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", lines:[148, 165], file:"lib/enumerable.fy", arg:["str"]}, "each_with_index:":{doc:"Iterate over all elements in self
.\nCalls a given Block
with each element and its index.
Forward to message superior_by:taking:
\n\n\n\n", lines:[491, 522], file:"lib/enumerable.fy", arg:["comparison_block"]}, "join_by:":{doc:"Works similar to Fancy
Enumerable
inject:into:
but uses first element as value injected.
Example:
\n\n (1,2,3) reduce_by: '+ # => same as: (2,3) inject: 1 into: '+\n
\n\n \n\n", lines:[167, 180], file:"lib/enumerable.fy", arg:["block"]}, "take_while:":{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", lines:[323, 344], file:"lib/enumerable.fy", arg:["condition"]}, "last:":{doc:"Example:
\n\n (1,2,3,4) last: 2 # => [3,4]\n
\n\n \n\n", lines:[107, 122], file:"lib/enumerable.fy", arg:["amount"]}, "map:":{doc:"Returns a new Array
with the results of calling a given block for every element.
Returns the size of an Enumerable.
\n\n \n\n", lines:[455, 467], file:"lib/enumerable.fy", arg:[]}, "any?:":{doc:"Indicates, if any element meets the condition.
\n\n \n\n", lines:[182, 196], file:"lib/enumerable.fy", arg:["condition"]}, "take:":{doc:"Example:
\n\n [1,2,3,4] take: 2 # => [1,2]\n
\n\n \n\n", lines:[374, 388], file:"lib/enumerable.fy", arg:["amount"]}, "drop_while:":{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", lines:[346, 372], file:"lib/enumerable.fy", arg:["condition"]}, "each:in_between:":{doc:"Similar to each:
but calls an additional Block
between\ncalling the first Block
for each element in self.
Example:
\n\n \"hello world\" grep: /[a-h]/ taking: @{ upcase } # => [\"H\", \"E\", \"D\"]\n [\"hello\", \"world\", 1, 2, 3] grep: String taking: 'upcase # => [\"HELLO\", \"WORLD\"]\n
\n\n \n\n", lines:[784, 802], file:"lib/enumerable.fy", arg:["pattern", "block"]}, "to_hash:":{doc:"Example:
\n\n [\"foo\", \\\342\200\235hello\", \"ok\", \"\"] to_hash: @{ size }\n # => <[3 => \"foo\", 5 => \"hello\", 2 => \"ok\", 0 => \"\"]>\n
\n\n \n\n", lines:[665, 681], file:"lib/enumerable.fy", arg:["block"]}, "split_with:":{doc:"Example:
\n\n [1,2,3,4,5] split_with: @{ < 3 } # => [[1, 2], [3, 4, 5]]\n
\n\n \n\n", lines:[759, 769], file:"lib/enumerable.fy", arg:["predicate_block"]}, ":min":{doc:"Returns the minimum value in the Enumerable (via the '<' comparison message).
\n\n \n\n", lines:[534, 542], file:"lib/enumerable.fy", arg:[]}, "sort_by:":{doc:"Sorts a collection by a given comparison block.
\n\n \n\n", lines:[604, 619], file:"lib/enumerable.fy", arg:["block"]}, "in_groups_of:":{doc:"Example usage:
\n\n [1,2,3,4,5] in_groups_of: 3 # => [[1,2,3],[4,5]]\n
\n\n \n\n", lines:[621, 651], file:"lib/enumerable.fy", arg:["size"]}, ":sorted?":{doc:"Example:
\n\n (1,2,3) sorted? # => true\n (2,1,3) sorted? # => false\n \"abc\" sorted? # => true\n \"bac\" sorted? # => false\n
\n\n \n\n", lines:[726, 745], file:"lib/enumerable.fy", arg:[]}, ":empty?":{doc:"Indicates, if the Enumerable is empty (has no elements).
\n\n \n\n", lines:[469, 477], file:"lib/enumerable.fy", arg:[]}, ":fourth":{doc:"\n\n \n\n", lines:[62, 67], file:"lib/enumerable.fy", arg:[]}, ":to_s":{doc:"Example:
\n\n (1,2,3) to_s # => \"123\"\n [1,2,3] to_s # => \"123\"\n \"foo\" to_s # => \"foo\"\n
\n\n \n\n", lines:[713, 724], file:"lib/enumerable.fy", arg:[]}, ":third":{doc:"\n\n \n\n", lines:[55, 60], file:"lib/enumerable.fy", arg:[]}, ":compact":{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", lines:[479, 490], file:"lib/enumerable.fy", arg:[]}, "select:":{doc:"Returns a new Array
with all elements that meet the given condition block.
Returns a new Array
with the results of calling a given block for every element and its index.
Returns the superior element in the Fancy
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", lines:[492, 522], file:"lib/enumerable.fy", arg:["comparison_block", "selection_block"]}, "inject:into:":{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", lines:[424, 434], file:"lib/enumerable.fy", arg:["val", "block"]}, ":last":{doc:"Returns the last element in a Fancy
Enumerable
.
Calculates the sum of all the elements in the Enumerable
\n(assuming them to be Number
s (implementing '+' & '*')).
Example:
\n\n (0..10) count: @{ even? } # => 6 (even numbers are: 0,2,4,6,8,10)\n [1,2,3] count: @{ odd? } # => 2\n [1,2, \"foo\"] count: @{ class == String } # => 1\n
\n\n \n\n", lines:[695, 711], file:"lib/enumerable.fy", arg:["block"]}, "find:":{doc:"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
.
Forward to message join:
\n\n\n\n", lines:[147, 165], file:"lib/enumerable.fy", arg:[]}, ":product":{doc:"Calculates the product of all the elements in the Enumerable
\n(assuming them to be Number
s (implementing +
& *
)).
Example:
\n\n (1,2,3) map_chained: (@{ + 1 }, 'to_s, @{ * 2 })\n # => [\"22\", \"33\", \"44\"]\n
\n\n \n\n", lines:[278, 293], file:"lib/enumerable.fy", arg:["blocks"]}, ":second":{doc:"\n\n \n\n", lines:[48, 53], file:"lib/enumerable.fy", arg:[]}, "partition_by:":{doc:"Example:
\n\n (0..10) partition_by: @{ < 3 } # => [[0, 1, 2], [3, 4, 5, 6, 7, 8, 9, 10]]\n
\n\n \n\n", lines:[571, 594], file:"lib/enumerable.fy", arg:["block"]}, "at:":{doc:"Example:
\n\n \"foo\\\342\200\235 at: 2 # => \"o\"\n \"foo\\\342\200\235 at: 3 # => nil\n
\n\n \n\n", lines:[9, 23], file:"lib/enumerable.fy", arg:["index"]}}, methods:{}, ancestors:["Fancy Enumerable", "Object", "Kernel"]}, "Hash":{doc:"Class for Hashes (HashMaps / Dictionaries).\nMaps a key to a value.
\n\n\n\n", instance_methods:{":to_block":{doc:"Example:
\n\n <['x => 100, 'y => 150]> to_block\n # would be the same as:\n |receiver| {\n receiver tap: @{\n x: 100\n y: 150\n }\n }\n
\n\n \n\n", lines:[254, 278], file:"lib/hash.fy", arg:[]}, ":to_object":{doc:"Creates and returns a new Object
with slot names and values based on keys and values in self
.
Example:
\n\n o = <['name => \"Christopher Bertels\", 'interest => \"programming languages\"]> to_object\n o name # => \"Christopher Bertels\"\n o interest # => 42\n
\n\n \n\n", lines:[122, 140], file:"lib/hash.fy", arg:[]}, ":random_value":{doc:"\n\n \n\n", lines:[207, 213], file:"lib/hash.fy", arg:[]}, ":[]":{doc:"Returns the value for a given key.
\n\n \n\n", lines:[12, 21], file:"lib/hash.fy", arg:["key"]}, "call:":{doc:"Sends each key-value pair as a message (with one argument) to receiver
.
Example:
\n\n Person = Struct new: ('firstname, 'lastname)\n p = Person new\n <['firstname => \"Tom\", 'lastname => \"Cruise\"]> call: [p]\n\n p firstname # => \"Tom\"\n p lastname # => \"Cruise\"\n
\n\n \n\n", lines:[225, 242], file:"lib/hash.fy", arg:["receiver"]}, "values_at:":{doc:"Example:
\n\n <['foo => 1, 'bar => 2, 'baz => 42]> values_at: ('foo, 'baz) # => [1, 42]\n
\n\n \n\n", lines:[155, 165], file:"lib/hash.fy", arg:["keys"]}, ":random_key":{doc:"\n\n \n\n", lines:[199, 205], file:"lib/hash.fy", arg:[]}, ":to_a":{doc:"Returns an Array
of the key-value pairs in a Hash
.
Example:
\n\n h = <['a => 1, 42 => (1,2,3), 'b => \"hello\"]>\n h select_keys: @{ is_a?: Symbol } # => <['a => 1, 'b => \"hello\"]>\n
\n\n \n\n", lines:[167, 184], file:"lib/hash.fy", arg:["block"]}, "each_key:":{doc:"Calls a given Block
with each key.
Deletes a key-value pair from self
.
Calls a given Block
with each key and value.
Indicates if a given key is in self
.
Example:
\n\n h = <['a => 1, 42 => (1,2,3), 'b => \"hello\"]>\n h reject_keys: @{ is_a?: Symbol } # => <[42 => (1,2,3)]>\n
\n\n \n\n", lines:[186, 197], file:"lib/hash.fy", arg:["block"]}, ":random":{doc:"Same as Hash
random_value
.
Calls a given Block
with each value.
Returns the value for a given key.\nIf the key is not found, calls else_block
and returns the value it yields.
Example:
\n\n <['foo => 'bar]> at: 'foo else: { 42 } # => 'bar\n <['foo => 'bar]> at: 'unknown else: { 42 } # => 42\n <['nil => nil]> at: 'nil else: { 'not_found } # => nil\n
\n\n \n\n", lines:[23, 43], file:"lib/hash.fy", arg:["key", "else_block"]}, "at:else_put:":{doc:"Example:
\n\n h = <['foo => 'bar]>\n h at: 'foo else_put: { 42 } # => 'bar\n h['foo] # => 'bar\n h at: 'undefined else_put: { 42 } # => 42\n h['undefined] # => 42\n
\n\n \n\n", lines:[47, 65], file:"lib/hash.fy", arg:["key", "else_block"]}, "fetch:else_put:":{doc:"Example:
\n\n h = <['foo => 'bar]>\n h at: 'foo else_put: { 42 } # => 'bar\n h['foo] # => 'bar\n h at: 'undefined else_put: { 42 } # => 42\n h['undefined] # => 42\n
\n\n \n\n", lines:[47, 65], file:"lib/hash.fy", arg:["key", "else_block"]}, "at:else:":{doc:"Returns the value for a given key.\nIf the key is not found, calls else_block
and returns the value it yields.
Example:
\n\n <['foo => 'bar]> at: 'foo else: { 42 } # => 'bar\n <['foo => 'bar]> at: 'unknown else: { 42 } # => 42\n <['nil => nil]> at: 'nil else: { 'not_found } # => nil\n
\n\n \n\n", lines:[23, 43], file:"lib/hash.fy", arg:["key", "else_block"]}}, methods:{}, ancestors:["Hash", "Fancy Enumerable", "Object", "Enumerable", "Object", "Kernel"]}, "FalseClass":{doc:"FalseClass. The class of the singleton false
value.
Calls else_block
.
Calls block
with self
.
Boolean negation of false
=> true
.
Calls else_block
with self
.
Calls then_block
with self
.
TrueClass. The class of the singleton true
value.
Calls then_block
with self
.
Calls block
with self
.
Exception class that gets thrown when a method wasn't found within a class.
\n\n\n\n", instance_methods:{":method_name":{doc:"Returns the name of the method that was not found as a String
.
NoMethodError
\n\n\n\n", lines:[19, 21], file:"lib/rbx/no_method_error.fy", arg:[]}}, ancestors:["NoMethodError", "NameError", "StandardError", "Exception", "Object", "Kernel"]}, "MatchData":{doc:"MatchData instances are created when using the #=== match operator\n(e.g. by using match/case expressions).
\n\n\n\n", instance_methods:{":to_a":{doc:"\n\n \n\n", lines:[20, 30], file:"lib/rbx/match_data.fy", arg:[]}, "at:":{doc:"\n\n \n\n", lines:[11, 18], file:"lib/rbx/match_data.fy", arg:["idx"]}}, methods:{}, ancestors:["MatchData", "Unmarshalable", "Object", "Kernel"]}, "DynamicValueArray":{doc:"Helper class to dynamically create Array
s with values defined by sending messages to it.
Example:
\n\n dva = DynamicValueArray new\n dva name: \"Chris\"\n dva age: 25\n dva country: \"Germany\"\n dva something_else\n\n dva array # => [['name, \"Chris\"], ['age, 25], ['country, \"Germany\"], 'something_else]\n
\n\n\n\n", instance_methods:{":array":{doc:"\n\n \n\n", lines:[94, 100], file:"lib/dynamic_slot_object.fy", arg:[]}}, methods:{}, ancestors:["DynamicValueArray", "Fancy BasicObject", "Object", "Kernel"]}, "UnboundMethod":{doc:"An instance UnboundMethod represents a Method object not bound to a specific Class
or Object
.
Forward to message call:
\n\n\n\n", lines:[95, 98], file:"lib/rbx/method.fy", arg:[]}}, methods:{}, ancestors:["UnboundMethod", "MethodMixin", "Object", "Object", "Kernel"]}, "Fancy Documentation":{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", instance_methods:{":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"}, ":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"}, "format:":{doc:"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", lines:[50, 61], file:"lib/documentation.fy", arg:["format"]}}, methods:{"formatter:":{doc:"Obtains a formatter by a given name. Returns a callable object.
\n\n\n\n", lines:[78, 84], file:"lib/documentation.fy", arg:["name"]}, "for:append:":{doc:"Append docstring to the documentation for obj.\nIf obj has no documentation, one is created for it.
\n\n\n\n", lines:[63, 76], file:"lib/documentation.fy", arg:["obj", "docstring"]}, "for:is:":{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", lines:[24, 42], file:"lib/rbx/documentation.fy", arg:["obj", "docstring"]}, "remove:":{doc:"Removes the documentation for obj.
\n\n\n\n", lines:[60, 63], file:"lib/rbx/documentation.fy", arg:["obj"]}, "for_method:on_class:is:":{doc:"Similar to Fancy
Documentation
but taking the method name and the
Class
for which Method
to define the docstring.
Obtain the hash of known documentation formatters.
\n\n\n\n", lines:[94, 101], file:"lib/documentation.fy", arg:[]}, "formatter:is:":{doc:"Registers a callable object as formatter under name.
\n\n\n\n", lines:[86, 92], file:"lib/documentation.fy", arg:["name", "callable"]}, "for:":{doc:"Obtains the Fancy Documentation for obj.
\n\n\n\n", lines:[55, 58], file:"lib/rbx/documentation.fy", arg:["obj"]}}, ancestors:["Fancy Documentation", "Object", "Kernel"]}, "Fixnum":{doc:"Standard class for integer values in Fancy.
\n\n\n\n", instance_methods:{}, methods:{}, ancestors:["Fixnum", "Number", "Object", "ImmediateValue", "Integer", "Precision", "Numeric", "Comparable", "Object", "Kernel"]}, "Range":{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", instance_methods:{"initialize:to:":{doc:"Initializes a new Range starting at start
and ending at end
.
Same as Range#inspect
\n\n\n\n", lines:[13, 19], file:"lib/range.fy", arg:[]}, ":inspect":{doc:"\n\n \n\n", lines:[21, 27], file:"lib/range.fy", arg:[]}, "each:":{doc:"Calls block
on each value in self
. Used for iterating over a Range
.
NameError exception class. Used within Rubinius.
\n\n\n\n", instance_methods:{}, methods:{}, ancestors:["NameError", "StandardError", "Exception", "Object", "Kernel"]}}, methods:{"Module#included:":{doc:"Gets called when a Class
or Module
is included into another Class
.
Runs a given block if an option is in ARGV.
\n\n\n\n", args:["op_name", "block"]}, "Matchers MatchAny#:===":{doc:"\n\n \n\n", args:["object"]}, "Fancy Package Installer#initialize:":{doc:"Forward to message initialize:version:install_path:
\n\n\n\n", args:["@package_name"]}, "Fancy Package Installer#fulfill_spec:":{doc:"Installs all dependencies of spec
, sets up symlinks for binary files in spec
,\nas well as installing the include-file into the Fancy package lib dir.
Creates a new Fancy
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).
Returns the latest tag (sorted alphabetically).
\n\n\n\n", args:[]}, "Fancy Package Installer#unpack_file:":{doc:"Unpacks the given filename
and installs it into Fancy's package install dir.
Forward to message install:version:
\n\n\n\n", args:["package_name"]}, "Fancy Package Installer#download_url:":{doc:"Returns the download url for a given version of the package\nto be installed.
\n\n\n\n", args:["version"]}, "Fancy Package Installer#initialize:version:":{doc:"Forward to message initialize:version:install_path:
\n\n\n\n", args:["@package_name", "@version"]}, "Object#for_options:do:":{doc:"Runs a given block if any of the given options is in ARGV.
\n\n\n\n", args:["op_names", "block"]}, "Module#[]:":{doc:"Sets the value of a constant with the given name in self
.
Forward to message write:call:
\n\n\n\n", args:["filename"]}, "Fancy Package RubyDependency#:install":{doc:"Installs the RubyDependency (a RubyGem) via rbx -S gem on the system.
\n\n\n\n", args:[]}, "Fancy Package Handler#load_fancypack:":{doc:"Forward to message load_fancypack:else:
\n\n\n\n", args:["success_block"]}, "Fancy Package#:install_dependencies":{doc:"Installs dependencies found in .fancypack file in the current directory.\nIf no .fancypack file is found, fails and quits.
\n\n\n\n", args:[]}, "Fancy Package#:list_packages":{doc:"Lists (prints) all installed packages on this system.
\n\n\n\n", args:[]}, "Fancy Package Specification#add_dependency:":{doc:"Forward to message add_dependency:version:
\n\n\n\n", args:["name"]}, "Fancy Enumerator#initialize:":{doc:"Initializes a new Enumerator with a given collection
,\nusing #each: for iteration.
Loads the @.fancypack file within the downloaded package directory.\nIf no @.fancypack file is found, raise an error.
\n\n\n\n", args:["success_block", "else_block"]}, "Fancy Enumerator#:peek":{doc:"Returns the next object in the Enumerator, 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", args:[]}, "Fancy Package#:add_to_loadpath":{doc:"Adds the Fancy Package install dir to the loadpath so you can\neasily require:
packages into your code.
Forward to message initialize:version:
\n\n\n\n", args:["@name"]}, "Fancy Enumerator#each:":{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 initialize:version:
\n\n\n\n", args:["@gem_name"]}, "Object#with_mutable_slots:do:":{doc:"Calls block
with self
while having slots defined in slotnames
\nbe mutable during execution of block
.
Runs the installer & installs the package into\n$FANCY_PACKAGE_DIR
.
Returns the value of the constant with the given name in self
.
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", args:["package_name", "version"]}, "Fancy Documentation RDiscount#rdiscount:":{doc:"Format string as HTML using RDiscount ruby gem.
\n\n\n\n", args:["doc"]}, "Fancy Package Installer#rename_dir:":{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", args:["dirname"]}, "Fancy Enumerator#initialize:with:":{doc:"Initializes a new Enumerator with a given collection
\nand iterator
selector to be used for iteration.
Forward to message add_ruby_dependency:version:
\n\n\n\n", args:["gem_name"]}, "Fancy Package#:root_dir":{doc:"\n\n \n\n", args:[]}, "Fancy Package Handler#initialize:":{doc:"Forward to message initialize:install_path:
\n\n\n\n", args:["@package_name"]}, "Fancy Enumerator#:next":{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", args:[]}, "Fancy Enumerator#:ended?":{doc:"Indicates if an enumerator has ended (no more values left).
\n\n \n\n", args:[]}, "Fancy Enumerator#:rewind":{doc:"Resets the enumerator to start from the collection's beginning.
\n\n\n\n", args:[]}, "Fancy Package Installer#download_tgz:":{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.
Raises a new StdError with self
as the message.
Uninstalls a package with a given name (if installed).
\n\n \n\n", args:["package_name"]}, "Fancy Package Installer#has_version?:":{doc:"Indicates, if a given version for this package is available on Github.
\n\n \n\n", args:["version"]}, "Fancy Enumerator#with:each:":{doc:"Similar to #each: but also passing in a given object
to each invocation of block
.