OSDN Git Service

Regular updates
[twpd/master.git] / tomdoc.md
1 ---
2 title: Tomdoc
3 category: Markup
4 layout: 2017/sheet
5 ---
6
7 ### Tomdoc
8 {: .-prime}
9
10 ```ruby
11 # Public: Duplicate some text an arbitrary number of times.
12 #
13 # text  - The String to be duplicated.
14 # count - The Integer number of times to duplicate the text.
15 #
16 # Examples
17 #
18 #   multiplex('Tom', 4)
19 #   # => 'TomTomTomTom'
20 #
21 # Returns the duplicated String.
22 def multiplex(text, count)
23   text * count
24 end
25 ```
26
27 See [tomdoc.org](http://tomdoc.org/).
28
29 ### Tags
30
31 - `Deprecated`
32 - `Internal`
33 - `Public`
34
35 ### Options
36
37 ```ruby
38 # options - The Hash options used to refine the selection (default: {}):
39 #           :color  - The String color to restrict by (optional).
40 #           :weight - The Float weight to restrict by. The weight should
41 #                     be specified in grams (optional).
42 ```
43
44 ### Yields
45
46 ```ruby
47 # Yields the Integer index of the iteration.
48 ```
49
50 ```ruby
51 # Returns the duplicated String.
52 ```
53
54 ```ruby
55 # Returns nothing.
56 ```
57
58 ```ruby
59 # Raises Errno::ENOENT if the file can't be found.
60 ```
61
62 ```ruby
63 # Returns something else and this is a wrapped
64 #   multi-line comment.
65 ```
66
67 ### Signatures
68
69 ```ruby
70 # Signature
71 #
72 #   find_by_<field>[_and_<field>...](args)
73 #
74 ```