gravaty 9.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG +835 -0
- data/COPYING.md +675 -0
- data/Gemfile +21 -0
- data/ISSUES.md +62 -0
- data/README.md +287 -0
- data/Rakefile +52 -0
- data/acknowledgements.md +66 -0
- data/authors.md +63 -0
- data/copyright.md +468 -0
- data/examples/avatar.rb +159 -0
- data/examples/basics.rb +75 -0
- data/examples/cacert.pem +3401 -0
- data/examples/profile.rb +187 -0
- data/examples/xmlrpc.rb +41 -0
- data/gravaty.gemspec +78 -0
- data/gravaty.odp +0 -0
- data/gravaty.pdf +0 -0
- data/html/CHANGELOG.html +1117 -0
- data/html/COPYING_md.html +393 -0
- data/html/Gemfile.html +108 -0
- data/html/Gravaty/Gravaty.html +1002 -0
- data/html/Gravaty/ParsableDuckType.html +162 -0
- data/html/Gravaty/Parser.html +239 -0
- data/html/Gravaty/Parsers/Avatar.html +169 -0
- data/html/Gravaty/Parsers/Callback.html +170 -0
- data/html/Gravaty/Parsers/Default.html +178 -0
- data/html/Gravaty/Parsers/Force.html +170 -0
- data/html/Gravaty/Parsers/Format.html +181 -0
- data/html/Gravaty/Parsers/Pixelsize.html +181 -0
- data/html/Gravaty/Parsers/Rating.html +181 -0
- data/html/Gravaty/Parsers/Secure.html +169 -0
- data/html/Gravaty/Parsers/Type.html +181 -0
- data/html/Gravaty/Parsers.html +96 -0
- data/html/Gravaty/Utils/Downloader/Downloader.html +227 -0
- data/html/Gravaty/Utils/Downloader.html +108 -0
- data/html/Gravaty/Utils/Raisers.html +203 -0
- data/html/Gravaty/Utils/Rfc5322.html +139 -0
- data/html/Gravaty/Utils/RpcConnector/RpcConnector.html +248 -0
- data/html/Gravaty/Utils/RpcConnector.html +111 -0
- data/html/Gravaty/Utils.html +111 -0
- data/html/Gravaty.html +320 -0
- data/html/ISSUES_md.html +165 -0
- data/html/Object.html +187 -0
- data/html/README_md.html +276 -0
- data/html/Rakefile.html +141 -0
- data/html/acknowledgements_md.html +160 -0
- data/html/authors_md.html +173 -0
- data/html/copyright_md.html +481 -0
- data/html/created.rid +59 -0
- data/html/css/fonts.css +167 -0
- data/html/css/rdoc.css +590 -0
- data/html/examples/cacert_pem.html +1056 -0
- data/html/fonts/Lato-Light.ttf +0 -0
- data/html/fonts/Lato-LightItalic.ttf +0 -0
- data/html/fonts/Lato-Regular.ttf +0 -0
- data/html/fonts/Lato-RegularItalic.ttf +0 -0
- data/html/fonts/SourceCodePro-Bold.ttf +0 -0
- data/html/fonts/SourceCodePro-Regular.ttf +0 -0
- data/html/gravaty_gemspec.html +169 -0
- data/html/images/add.png +0 -0
- data/html/images/arrow_up.png +0 -0
- data/html/images/brick.png +0 -0
- data/html/images/brick_link.png +0 -0
- data/html/images/bug.png +0 -0
- data/html/images/bullet_black.png +0 -0
- data/html/images/bullet_toggle_minus.png +0 -0
- data/html/images/bullet_toggle_plus.png +0 -0
- data/html/images/date.png +0 -0
- data/html/images/delete.png +0 -0
- data/html/images/find.png +0 -0
- data/html/images/loadingAnimation.gif +0 -0
- data/html/images/macFFBgHack.png +0 -0
- data/html/images/package.png +0 -0
- data/html/images/page_green.png +0 -0
- data/html/images/page_white_text.png +0 -0
- data/html/images/page_white_width.png +0 -0
- data/html/images/plugin.png +0 -0
- data/html/images/ruby.png +0 -0
- data/html/images/tag_blue.png +0 -0
- data/html/images/tag_green.png +0 -0
- data/html/images/transparent.png +0 -0
- data/html/images/wrench.png +0 -0
- data/html/images/wrench_orange.png +0 -0
- data/html/images/zoom.png +0 -0
- data/html/index.html +308 -0
- data/html/js/darkfish.js +161 -0
- data/html/js/jquery.js +4 -0
- data/html/js/navigation.js +141 -0
- data/html/js/navigation.js.gz +0 -0
- data/html/js/search.js +109 -0
- data/html/js/search_index.js +1 -0
- data/html/js/search_index.js.gz +0 -0
- data/html/js/searcher.js +229 -0
- data/html/js/searcher.js.gz +0 -0
- data/html/table_of_contents.html +995 -0
- data/lib/gravaty/application.rb +354 -0
- data/lib/gravaty/constants.rb +65 -0
- data/lib/gravaty/locales/en.yml +38 -0
- data/lib/gravaty/locales/it.yml +38 -0
- data/lib/gravaty/locales/ja.yml +39 -0
- data/lib/gravaty/parser.rb +50 -0
- data/lib/gravaty/parsers/avatar.rb +40 -0
- data/lib/gravaty/parsers/callback.rb +41 -0
- data/lib/gravaty/parsers/default.rb +92 -0
- data/lib/gravaty/parsers/force.rb +40 -0
- data/lib/gravaty/parsers/format.rb +45 -0
- data/lib/gravaty/parsers/pixelsize.rb +45 -0
- data/lib/gravaty/parsers/rating.rb +45 -0
- data/lib/gravaty/parsers/secure.rb +39 -0
- data/lib/gravaty/parsers/type.rb +45 -0
- data/lib/gravaty/utils/downloader.rb +156 -0
- data/lib/gravaty/utils/raisers.rb +63 -0
- data/lib/gravaty/utils/rfc5322.rb +110 -0
- data/lib/gravaty/utils/rpc_connector.rb +86 -0
- data/lib/gravaty/version.rb +24 -0
- data/lib/gravaty.rb +75 -0
- data/test/gravaty/locales/test_locales.rb +69 -0
- data/test/gravaty/parsers/test_avatar.rb +39 -0
- data/test/gravaty/parsers/test_callback.rb +42 -0
- data/test/gravaty/parsers/test_default.rb +79 -0
- data/test/gravaty/parsers/test_force.rb +39 -0
- data/test/gravaty/parsers/test_format.rb +54 -0
- data/test/gravaty/parsers/test_pixelsize.rb +56 -0
- data/test/gravaty/parsers/test_rating.rb +54 -0
- data/test/gravaty/parsers/test_secure.rb +39 -0
- data/test/gravaty/parsers/test_type.rb +44 -0
- data/test/gravaty/test_application.rb +126 -0
- data/test/gravaty/test_avatar.rb +122 -0
- data/test/gravaty/test_parser.rb +59 -0
- data/test/gravaty/test_profile.rb +70 -0
- data/test/gravaty/utils/test_downloader.rb +51 -0
- data/test/gravaty/utils/test_raisers.rb +62 -0
- data/test/gravaty/utils/test_rfc5322.rb +82 -0
- data/test/gravaty/utils/test_rpc_connector.rb +82 -0
- data/test/test_gravaty.rb +48 -0
- data/test/test_helper.rb +105 -0
- metadata +348 -0
@@ -0,0 +1,170 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class Gravaty::Parsers::Callback - gravaty 9.0.0</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "../../";
|
11
|
+
var index_rel_prefix = "../../";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="../../js/jquery.js"></script>
|
15
|
+
<script src="../../js/darkfish.js"></script>
|
16
|
+
|
17
|
+
<link href="../../css/fonts.css" rel="stylesheet">
|
18
|
+
<link href="../../css/rdoc.css" rel="stylesheet">
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" role="document" class="class">
|
24
|
+
<nav role="navigation">
|
25
|
+
<div id="project-navigation">
|
26
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
27
|
+
<h2>
|
28
|
+
<a href="../../index.html" rel="home">Home</a>
|
29
|
+
</h2>
|
30
|
+
|
31
|
+
<div id="table-of-contents-navigation">
|
32
|
+
<a href="../../table_of_contents.html#pages">Pages</a>
|
33
|
+
<a href="../../table_of_contents.html#classes">Classes</a>
|
34
|
+
<a href="../../table_of_contents.html#methods">Methods</a>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
|
38
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
39
|
+
<form action="#" method="get" accept-charset="utf-8">
|
40
|
+
<div id="search-field-wrapper">
|
41
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
42
|
+
aria-autocomplete="list" aria-controls="search-results"
|
43
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
44
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<ul id="search-results" aria-label="Search Results"
|
48
|
+
aria-busy="false" aria-expanded="false"
|
49
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
50
|
+
</form>
|
51
|
+
</div>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
<div id="class-metadata">
|
58
|
+
|
59
|
+
<div id="parent-class-section" class="nav-section">
|
60
|
+
<h3>Parent</h3>
|
61
|
+
|
62
|
+
|
63
|
+
<p class="link"><a href="../../Object.html">Object</a>
|
64
|
+
|
65
|
+
</div>
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<!-- Method Quickref -->
|
70
|
+
<div id="method-list-section" class="nav-section">
|
71
|
+
<h3>Methods</h3>
|
72
|
+
|
73
|
+
<ul class="link-list" role="directory">
|
74
|
+
|
75
|
+
<li ><a href="#method-i-parse">#parse</a>
|
76
|
+
|
77
|
+
</ul>
|
78
|
+
</div>
|
79
|
+
|
80
|
+
</div>
|
81
|
+
</nav>
|
82
|
+
|
83
|
+
<main role="main" aria-labelledby="class-Gravaty::Parsers::Callback">
|
84
|
+
<h1 id="class-Gravaty::Parsers::Callback" class="class">
|
85
|
+
class Gravaty::Parsers::Callback
|
86
|
+
</h1>
|
87
|
+
|
88
|
+
<section class="description">
|
89
|
+
|
90
|
+
<p>This class is an implementation of the Parsable duck type that provides the callback name. The only needed parameter is a valid callback <code>String</code> name.</p>
|
91
|
+
<dl class="rdoc-list note-list"><dt>Author
|
92
|
+
<dd>
|
93
|
+
<p><a href="mailto:marcobresciani_1974@libero.it">Marco Bresciani</a></p>
|
94
|
+
</dd><dt>Copyright
|
95
|
+
<dd>
|
96
|
+
<p>Copyright © 2013, 2014, 2015, 2016, 2017, 2018,</p>
|
97
|
+
</dd></dl>
|
98
|
+
|
99
|
+
<p>2019 Marco Bresciani</p>
|
100
|
+
<dl class="rdoc-list note-list"><dt>License
|
101
|
+
<dd>
|
102
|
+
<p>GNU General Public License version 3</p>
|
103
|
+
</dd></dl>
|
104
|
+
|
105
|
+
</section>
|
106
|
+
|
107
|
+
|
108
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
119
|
+
<header>
|
120
|
+
<h3>Public Instance Methods</h3>
|
121
|
+
</header>
|
122
|
+
|
123
|
+
|
124
|
+
<div id="method-i-parse" class="method-detail ">
|
125
|
+
|
126
|
+
<div class="method-heading">
|
127
|
+
<span class="method-name">parse</span><span
|
128
|
+
class="method-args">(value = nil)</span>
|
129
|
+
|
130
|
+
<span class="method-click-advice">click to toggle source</span>
|
131
|
+
|
132
|
+
</div>
|
133
|
+
|
134
|
+
|
135
|
+
<div class="method-description">
|
136
|
+
|
137
|
+
<p>The parsable duck type interface to every parser usage.</p>
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
<div class="method-source-code" id="parse-source">
|
143
|
+
<pre> <span class="ruby-comment"># File lib/gravaty/parsers/callback.rb</span>
|
144
|
+
<span class="line-num">35</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">parse</span>(<span class="ruby-identifier">value</span> = <span class="ruby-keyword">nil</span>)
|
145
|
+
<span class="line-num">36</span> <span class="ruby-keyword">return</span> <span class="ruby-node">"callback=#{value}"</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">empty?</span>
|
146
|
+
<span class="line-num">37</span> <span class="ruby-string">''</span>
|
147
|
+
<span class="line-num">38</span> <span class="ruby-keyword">end</span></pre>
|
148
|
+
</div>
|
149
|
+
|
150
|
+
</div>
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
</div>
|
156
|
+
|
157
|
+
|
158
|
+
</section>
|
159
|
+
|
160
|
+
</section>
|
161
|
+
|
162
|
+
</main>
|
163
|
+
|
164
|
+
|
165
|
+
<footer id="validator-badges" role="contentinfo">
|
166
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
167
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.1.1.
|
168
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
169
|
+
</footer>
|
170
|
+
|
@@ -0,0 +1,178 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class Gravaty::Parsers::Default - gravaty 9.0.0</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "../../";
|
11
|
+
var index_rel_prefix = "../../";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="../../js/jquery.js"></script>
|
15
|
+
<script src="../../js/darkfish.js"></script>
|
16
|
+
|
17
|
+
<link href="../../css/fonts.css" rel="stylesheet">
|
18
|
+
<link href="../../css/rdoc.css" rel="stylesheet">
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" role="document" class="class">
|
24
|
+
<nav role="navigation">
|
25
|
+
<div id="project-navigation">
|
26
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
27
|
+
<h2>
|
28
|
+
<a href="../../index.html" rel="home">Home</a>
|
29
|
+
</h2>
|
30
|
+
|
31
|
+
<div id="table-of-contents-navigation">
|
32
|
+
<a href="../../table_of_contents.html#pages">Pages</a>
|
33
|
+
<a href="../../table_of_contents.html#classes">Classes</a>
|
34
|
+
<a href="../../table_of_contents.html#methods">Methods</a>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
|
38
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
39
|
+
<form action="#" method="get" accept-charset="utf-8">
|
40
|
+
<div id="search-field-wrapper">
|
41
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
42
|
+
aria-autocomplete="list" aria-controls="search-results"
|
43
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
44
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<ul id="search-results" aria-label="Search Results"
|
48
|
+
aria-busy="false" aria-expanded="false"
|
49
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
50
|
+
</form>
|
51
|
+
</div>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
<div id="class-metadata">
|
58
|
+
|
59
|
+
<div id="parent-class-section" class="nav-section">
|
60
|
+
<h3>Parent</h3>
|
61
|
+
|
62
|
+
|
63
|
+
<p class="link"><a href="../../Object.html">Object</a>
|
64
|
+
|
65
|
+
</div>
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<!-- Method Quickref -->
|
70
|
+
<div id="method-list-section" class="nav-section">
|
71
|
+
<h3>Methods</h3>
|
72
|
+
|
73
|
+
<ul class="link-list" role="directory">
|
74
|
+
|
75
|
+
<li ><a href="#method-i-parse">#parse</a>
|
76
|
+
|
77
|
+
</ul>
|
78
|
+
</div>
|
79
|
+
|
80
|
+
</div>
|
81
|
+
</nav>
|
82
|
+
|
83
|
+
<main role="main" aria-labelledby="class-Gravaty::Parsers::Default">
|
84
|
+
<h1 id="class-Gravaty::Parsers::Default" class="class">
|
85
|
+
class Gravaty::Parsers::Default
|
86
|
+
</h1>
|
87
|
+
|
88
|
+
<section class="description">
|
89
|
+
|
90
|
+
<p>This class is an implementation of the Parsable duck type that checks the default option. The only needed parameter is a valid default option.</p>
|
91
|
+
<dl class="rdoc-list note-list"><dt>Author
|
92
|
+
<dd>
|
93
|
+
<p><a href="mailto:marcobresciani_1974@libero.it">Marco Bresciani</a></p>
|
94
|
+
</dd><dt>Copyright
|
95
|
+
<dd>
|
96
|
+
<p>Copyright © 2013, 2014, 2015, 2016, 2017, 2018,</p>
|
97
|
+
</dd></dl>
|
98
|
+
|
99
|
+
<p>2019 Marco Bresciani</p>
|
100
|
+
<dl class="rdoc-list note-list"><dt>License
|
101
|
+
<dd>
|
102
|
+
<p>GNU General Public License version 3</p>
|
103
|
+
</dd></dl>
|
104
|
+
|
105
|
+
</section>
|
106
|
+
|
107
|
+
|
108
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
119
|
+
<header>
|
120
|
+
<h3>Public Instance Methods</h3>
|
121
|
+
</header>
|
122
|
+
|
123
|
+
|
124
|
+
<div id="method-i-parse" class="method-detail ">
|
125
|
+
|
126
|
+
<div class="method-heading">
|
127
|
+
<span class="method-name">parse</span><span
|
128
|
+
class="method-args">(value = nil)</span>
|
129
|
+
|
130
|
+
<span class="method-click-advice">click to toggle source</span>
|
131
|
+
|
132
|
+
</div>
|
133
|
+
|
134
|
+
|
135
|
+
<div class="method-description">
|
136
|
+
|
137
|
+
<p>The parsable duck type interface to every parser usage.</p>
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
<div class="method-source-code" id="parse-source">
|
143
|
+
<pre> <span class="ruby-comment"># File lib/gravaty/parsers/default.rb</span>
|
144
|
+
<span class="line-num">39</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">parse</span>(<span class="ruby-identifier">value</span> = <span class="ruby-keyword">nil</span>)
|
145
|
+
<span class="line-num">40</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">empty?</span>
|
146
|
+
<span class="line-num">41</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">DEFAULT_OPTIONS</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">value</span>
|
147
|
+
<span class="line-num">42</span> <span class="ruby-identifier">valid</span> = <span class="ruby-node">%w(http https)</span>.<span class="ruby-identifier">index</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">scheme</span><span class="ruby-operator">|</span> <span class="ruby-identifier">valid?</span>(<span class="ruby-identifier">value</span>, <span class="ruby-identifier">scheme</span>)}
|
148
|
+
<span class="line-num">43</span>
|
149
|
+
<span class="line-num">44</span> <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-constant">I18n</span>.<span class="ruby-identifier">t</span>(<span class="ruby-string">'error.uri'</span>, <span class="ruby-value">value:</span> <span class="ruby-identifier">value</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">valid</span>.<span class="ruby-identifier">nil?</span>
|
150
|
+
<span class="line-num">45</span> <span class="ruby-keyword">end</span>
|
151
|
+
<span class="line-num">46</span>
|
152
|
+
<span class="line-num">47</span> <span class="ruby-keyword">return</span> <span class="ruby-string">'d='</span> <span class="ruby-operator">+</span> <span class="ruby-constant">CGI</span><span class="ruby-operator">::</span><span class="ruby-identifier">escape</span>(<span class="ruby-identifier">value</span>).<span class="ruby-identifier">to_s</span>
|
153
|
+
<span class="line-num">48</span> <span class="ruby-keyword">end</span>
|
154
|
+
<span class="line-num">49</span> <span class="ruby-string">''</span>
|
155
|
+
<span class="line-num">50</span> <span class="ruby-keyword">end</span></pre>
|
156
|
+
</div>
|
157
|
+
|
158
|
+
</div>
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
</div>
|
164
|
+
|
165
|
+
|
166
|
+
</section>
|
167
|
+
|
168
|
+
</section>
|
169
|
+
|
170
|
+
</main>
|
171
|
+
|
172
|
+
|
173
|
+
<footer id="validator-badges" role="contentinfo">
|
174
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
175
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.1.1.
|
176
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
177
|
+
</footer>
|
178
|
+
|
@@ -0,0 +1,170 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class Gravaty::Parsers::Force - gravaty 9.0.0</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "../../";
|
11
|
+
var index_rel_prefix = "../../";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="../../js/jquery.js"></script>
|
15
|
+
<script src="../../js/darkfish.js"></script>
|
16
|
+
|
17
|
+
<link href="../../css/fonts.css" rel="stylesheet">
|
18
|
+
<link href="../../css/rdoc.css" rel="stylesheet">
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" role="document" class="class">
|
24
|
+
<nav role="navigation">
|
25
|
+
<div id="project-navigation">
|
26
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
27
|
+
<h2>
|
28
|
+
<a href="../../index.html" rel="home">Home</a>
|
29
|
+
</h2>
|
30
|
+
|
31
|
+
<div id="table-of-contents-navigation">
|
32
|
+
<a href="../../table_of_contents.html#pages">Pages</a>
|
33
|
+
<a href="../../table_of_contents.html#classes">Classes</a>
|
34
|
+
<a href="../../table_of_contents.html#methods">Methods</a>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
|
38
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
39
|
+
<form action="#" method="get" accept-charset="utf-8">
|
40
|
+
<div id="search-field-wrapper">
|
41
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
42
|
+
aria-autocomplete="list" aria-controls="search-results"
|
43
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
44
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<ul id="search-results" aria-label="Search Results"
|
48
|
+
aria-busy="false" aria-expanded="false"
|
49
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
50
|
+
</form>
|
51
|
+
</div>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
<div id="class-metadata">
|
58
|
+
|
59
|
+
<div id="parent-class-section" class="nav-section">
|
60
|
+
<h3>Parent</h3>
|
61
|
+
|
62
|
+
|
63
|
+
<p class="link"><a href="../../Object.html">Object</a>
|
64
|
+
|
65
|
+
</div>
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<!-- Method Quickref -->
|
70
|
+
<div id="method-list-section" class="nav-section">
|
71
|
+
<h3>Methods</h3>
|
72
|
+
|
73
|
+
<ul class="link-list" role="directory">
|
74
|
+
|
75
|
+
<li ><a href="#method-i-parse">#parse</a>
|
76
|
+
|
77
|
+
</ul>
|
78
|
+
</div>
|
79
|
+
|
80
|
+
</div>
|
81
|
+
</nav>
|
82
|
+
|
83
|
+
<main role="main" aria-labelledby="class-Gravaty::Parsers::Force">
|
84
|
+
<h1 id="class-Gravaty::Parsers::Force" class="class">
|
85
|
+
class Gravaty::Parsers::Force
|
86
|
+
</h1>
|
87
|
+
|
88
|
+
<section class="description">
|
89
|
+
|
90
|
+
<p>This class is an implementation of the Parsable duck type that checks forces the default value. The only needed parameter is a boolean, with <code>true</code> for forced.</p>
|
91
|
+
<dl class="rdoc-list note-list"><dt>Author
|
92
|
+
<dd>
|
93
|
+
<p><a href="mailto:marcobresciani_1974@libero.it">Marco Bresciani</a></p>
|
94
|
+
</dd><dt>Copyright
|
95
|
+
<dd>
|
96
|
+
<p>Copyright © 2013, 2014, 2015, 2016, 2017, 2018,</p>
|
97
|
+
</dd></dl>
|
98
|
+
|
99
|
+
<p>2019 Marco Bresciani</p>
|
100
|
+
<dl class="rdoc-list note-list"><dt>License
|
101
|
+
<dd>
|
102
|
+
<p>GNU General Public License version 3</p>
|
103
|
+
</dd></dl>
|
104
|
+
|
105
|
+
</section>
|
106
|
+
|
107
|
+
|
108
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
119
|
+
<header>
|
120
|
+
<h3>Public Instance Methods</h3>
|
121
|
+
</header>
|
122
|
+
|
123
|
+
|
124
|
+
<div id="method-i-parse" class="method-detail ">
|
125
|
+
|
126
|
+
<div class="method-heading">
|
127
|
+
<span class="method-name">parse</span><span
|
128
|
+
class="method-args">(value = false)</span>
|
129
|
+
|
130
|
+
<span class="method-click-advice">click to toggle source</span>
|
131
|
+
|
132
|
+
</div>
|
133
|
+
|
134
|
+
|
135
|
+
<div class="method-description">
|
136
|
+
|
137
|
+
<p>The parsable duck type interface to every parser usage.</p>
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
<div class="method-source-code" id="parse-source">
|
143
|
+
<pre> <span class="ruby-comment"># File lib/gravaty/parsers/force.rb</span>
|
144
|
+
<span class="line-num">34</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">parse</span>(<span class="ruby-identifier">value</span> = <span class="ruby-keyword">false</span>)
|
145
|
+
<span class="line-num">35</span> <span class="ruby-keyword">return</span> <span class="ruby-string">'f=y'</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">value</span>
|
146
|
+
<span class="line-num">36</span> <span class="ruby-string">''</span>
|
147
|
+
<span class="line-num">37</span> <span class="ruby-keyword">end</span></pre>
|
148
|
+
</div>
|
149
|
+
|
150
|
+
</div>
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
</div>
|
156
|
+
|
157
|
+
|
158
|
+
</section>
|
159
|
+
|
160
|
+
</section>
|
161
|
+
|
162
|
+
</main>
|
163
|
+
|
164
|
+
|
165
|
+
<footer id="validator-badges" role="contentinfo">
|
166
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
167
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.1.1.
|
168
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
169
|
+
</footer>
|
170
|
+
|