cheatsheets/tomdoc.md

74 lines
1.1 KiB
Markdown
Raw Permalink Normal View History

2015-05-22 03:16:46 +02:00
---
title: Tomdoc
2015-11-24 06:02:17 +01:00
category: Markup
2015-05-22 03:16:46 +02:00
---
2017-09-20 10:08:11 +02:00
### Tomdoc
{: .-prime}
```ruby
2015-05-22 03:16:46 +02:00
# Public: Duplicate some text an arbitrary number of times.
#
# text - The String to be duplicated.
# count - The Integer number of times to duplicate the text.
#
# Examples
#
# multiplex('Tom', 4)
# # => 'TomTomTomTom'
#
# Returns the duplicated String.
def multiplex(text, count)
text * count
end
```
2017-09-20 10:08:11 +02:00
See [tomdoc.org](http://tomdoc.org/).
2015-05-22 03:16:46 +02:00
### Tags
2017-09-20 10:08:11 +02:00
- `Deprecated`
- `Internal`
- `Public`
2015-05-22 03:16:46 +02:00
### Options
2017-09-20 10:08:11 +02:00
```ruby
2015-05-22 03:16:46 +02:00
# options - The Hash options used to refine the selection (default: {}):
# :color - The String color to restrict by (optional).
# :weight - The Float weight to restrict by. The weight should
# be specified in grams (optional).
```
### Yields
2017-09-20 10:08:11 +02:00
```ruby
# Yields the Integer index of the iteration.
```
```ruby
# Returns the duplicated String.
2015-05-22 03:16:46 +02:00
```
2017-09-20 10:08:11 +02:00
```ruby
# Returns nothing.
2015-05-22 03:16:46 +02:00
```
2017-09-20 10:08:11 +02:00
```ruby
# Raises Errno::ENOENT if the file can't be found.
```
2015-05-22 03:16:46 +02:00
2017-09-20 10:08:11 +02:00
```ruby
# Returns something else and this is a wrapped
# multi-line comment.
2015-05-22 03:16:46 +02:00
```
2017-09-20 10:08:11 +02:00
### Signatures
```ruby
2015-05-22 03:16:46 +02:00
# Signature
#
# find_by_<field>[_and_<field>...](args)
#
```