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,181 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class Gravaty::Parsers::Format - 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
|
+
<div id="includes-section" class="nav-section">
|
68
|
+
<h3>Included Modules</h3>
|
69
|
+
|
70
|
+
<ul class="link-list">
|
71
|
+
|
72
|
+
|
73
|
+
<li><a class="include" href="../Utils/Raisers.html">Gravaty::Utils::Raisers</a>
|
74
|
+
|
75
|
+
|
76
|
+
</ul>
|
77
|
+
</div>
|
78
|
+
|
79
|
+
|
80
|
+
<!-- Method Quickref -->
|
81
|
+
<div id="method-list-section" class="nav-section">
|
82
|
+
<h3>Methods</h3>
|
83
|
+
|
84
|
+
<ul class="link-list" role="directory">
|
85
|
+
|
86
|
+
<li ><a href="#method-i-parse">#parse</a>
|
87
|
+
|
88
|
+
</ul>
|
89
|
+
</div>
|
90
|
+
|
91
|
+
</div>
|
92
|
+
</nav>
|
93
|
+
|
94
|
+
<main role="main" aria-labelledby="class-Gravaty::Parsers::Format">
|
95
|
+
<h1 id="class-Gravaty::Parsers::Format" class="class">
|
96
|
+
class Gravaty::Parsers::Format
|
97
|
+
</h1>
|
98
|
+
|
99
|
+
<section class="description">
|
100
|
+
|
101
|
+
<p>This class is an implementation of the Parsable duck type that checks the profile type. The only needed parameter is a valid profile format.</p>
|
102
|
+
<dl class="rdoc-list note-list"><dt>Author
|
103
|
+
<dd>
|
104
|
+
<p><a href="mailto:marcobresciani_1974@libero.it">Marco Bresciani</a></p>
|
105
|
+
</dd><dt>Copyright
|
106
|
+
<dd>
|
107
|
+
<p>Copyright © 2013, 2014, 2015, 2016, 2017, 2018,</p>
|
108
|
+
</dd></dl>
|
109
|
+
|
110
|
+
<p>2019 Marco Bresciani</p>
|
111
|
+
<dl class="rdoc-list note-list"><dt>License
|
112
|
+
<dd>
|
113
|
+
<p>GNU General Public License version 3</p>
|
114
|
+
</dd></dl>
|
115
|
+
|
116
|
+
</section>
|
117
|
+
|
118
|
+
|
119
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
130
|
+
<header>
|
131
|
+
<h3>Public Instance Methods</h3>
|
132
|
+
</header>
|
133
|
+
|
134
|
+
|
135
|
+
<div id="method-i-parse" class="method-detail ">
|
136
|
+
|
137
|
+
<div class="method-heading">
|
138
|
+
<span class="method-name">parse</span><span
|
139
|
+
class="method-args">(value = nil)</span>
|
140
|
+
|
141
|
+
<span class="method-click-advice">click to toggle source</span>
|
142
|
+
|
143
|
+
</div>
|
144
|
+
|
145
|
+
|
146
|
+
<div class="method-description">
|
147
|
+
|
148
|
+
<p>The parsable duck type interface to every parser usage.</p>
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
<div class="method-source-code" id="parse-source">
|
154
|
+
<pre> <span class="ruby-comment"># File lib/gravaty/parsers/format.rb</span>
|
155
|
+
<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>)
|
156
|
+
<span class="line-num">40</span> <span class="ruby-identifier">raiser_downcase</span>(<span class="ruby-string">'error.type'</span>, <span class="ruby-identifier">value</span>, <span class="ruby-constant">PROFILE_FORMATS</span>)
|
157
|
+
<span class="line-num">41</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">?</span> <span class="ruby-string">''</span> <span class="ruby-operator">:</span> <span class="ruby-node">".#{value.downcase}"</span>
|
158
|
+
<span class="line-num">42</span> <span class="ruby-keyword">end</span></pre>
|
159
|
+
</div>
|
160
|
+
|
161
|
+
</div>
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
</div>
|
167
|
+
|
168
|
+
|
169
|
+
</section>
|
170
|
+
|
171
|
+
</section>
|
172
|
+
|
173
|
+
</main>
|
174
|
+
|
175
|
+
|
176
|
+
<footer id="validator-badges" role="contentinfo">
|
177
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
178
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.1.1.
|
179
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
180
|
+
</footer>
|
181
|
+
|
@@ -0,0 +1,181 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class Gravaty::Parsers::Pixelsize - 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
|
+
<div id="includes-section" class="nav-section">
|
68
|
+
<h3>Included Modules</h3>
|
69
|
+
|
70
|
+
<ul class="link-list">
|
71
|
+
|
72
|
+
|
73
|
+
<li><a class="include" href="../Utils/Raisers.html">Gravaty::Utils::Raisers</a>
|
74
|
+
|
75
|
+
|
76
|
+
</ul>
|
77
|
+
</div>
|
78
|
+
|
79
|
+
|
80
|
+
<!-- Method Quickref -->
|
81
|
+
<div id="method-list-section" class="nav-section">
|
82
|
+
<h3>Methods</h3>
|
83
|
+
|
84
|
+
<ul class="link-list" role="directory">
|
85
|
+
|
86
|
+
<li ><a href="#method-i-parse">#parse</a>
|
87
|
+
|
88
|
+
</ul>
|
89
|
+
</div>
|
90
|
+
|
91
|
+
</div>
|
92
|
+
</nav>
|
93
|
+
|
94
|
+
<main role="main" aria-labelledby="class-Gravaty::Parsers::Pixelsize">
|
95
|
+
<h1 id="class-Gravaty::Parsers::Pixelsize" class="class">
|
96
|
+
class Gravaty::Parsers::Pixelsize
|
97
|
+
</h1>
|
98
|
+
|
99
|
+
<section class="description">
|
100
|
+
|
101
|
+
<p>This class is an implementation of the Parsable duck type that checks the image size. The only needed parameter is a valid image size.</p>
|
102
|
+
<dl class="rdoc-list note-list"><dt>Author
|
103
|
+
<dd>
|
104
|
+
<p><a href="mailto:marcobresciani_1974@libero.it">Marco Bresciani</a></p>
|
105
|
+
</dd><dt>Copyright
|
106
|
+
<dd>
|
107
|
+
<p>Copyright © 2013, 2014, 2015, 2016, 2017, 2018,</p>
|
108
|
+
</dd></dl>
|
109
|
+
|
110
|
+
<p>2019 Marco Bresciani</p>
|
111
|
+
<dl class="rdoc-list note-list"><dt>License
|
112
|
+
<dd>
|
113
|
+
<p>GNU General Public License version 3</p>
|
114
|
+
</dd></dl>
|
115
|
+
|
116
|
+
</section>
|
117
|
+
|
118
|
+
|
119
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
130
|
+
<header>
|
131
|
+
<h3>Public Instance Methods</h3>
|
132
|
+
</header>
|
133
|
+
|
134
|
+
|
135
|
+
<div id="method-i-parse" class="method-detail ">
|
136
|
+
|
137
|
+
<div class="method-heading">
|
138
|
+
<span class="method-name">parse</span><span
|
139
|
+
class="method-args">(value = nil)</span>
|
140
|
+
|
141
|
+
<span class="method-click-advice">click to toggle source</span>
|
142
|
+
|
143
|
+
</div>
|
144
|
+
|
145
|
+
|
146
|
+
<div class="method-description">
|
147
|
+
|
148
|
+
<p>The parsable duck type interface to every parser usage.</p>
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
<div class="method-source-code" id="parse-source">
|
154
|
+
<pre> <span class="ruby-comment"># File lib/gravaty/parsers/pixelsize.rb</span>
|
155
|
+
<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>)
|
156
|
+
<span class="line-num">40</span> <span class="ruby-identifier">raiser_to_i</span>(<span class="ruby-string">'error.value'</span>, <span class="ruby-identifier">value</span>, <span class="ruby-constant">ALLOWED_SIZES</span>)
|
157
|
+
<span class="line-num">41</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">?</span> <span class="ruby-string">''</span> <span class="ruby-operator">:</span> <span class="ruby-node">"s=#{value.to_s}"</span>
|
158
|
+
<span class="line-num">42</span> <span class="ruby-keyword">end</span></pre>
|
159
|
+
</div>
|
160
|
+
|
161
|
+
</div>
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
</div>
|
167
|
+
|
168
|
+
|
169
|
+
</section>
|
170
|
+
|
171
|
+
</section>
|
172
|
+
|
173
|
+
</main>
|
174
|
+
|
175
|
+
|
176
|
+
<footer id="validator-badges" role="contentinfo">
|
177
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
178
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.1.1.
|
179
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
180
|
+
</footer>
|
181
|
+
|
@@ -0,0 +1,181 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class Gravaty::Parsers::Rating - 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
|
+
<div id="includes-section" class="nav-section">
|
68
|
+
<h3>Included Modules</h3>
|
69
|
+
|
70
|
+
<ul class="link-list">
|
71
|
+
|
72
|
+
|
73
|
+
<li><a class="include" href="../Utils/Raisers.html">Gravaty::Utils::Raisers</a>
|
74
|
+
|
75
|
+
|
76
|
+
</ul>
|
77
|
+
</div>
|
78
|
+
|
79
|
+
|
80
|
+
<!-- Method Quickref -->
|
81
|
+
<div id="method-list-section" class="nav-section">
|
82
|
+
<h3>Methods</h3>
|
83
|
+
|
84
|
+
<ul class="link-list" role="directory">
|
85
|
+
|
86
|
+
<li ><a href="#method-i-parse">#parse</a>
|
87
|
+
|
88
|
+
</ul>
|
89
|
+
</div>
|
90
|
+
|
91
|
+
</div>
|
92
|
+
</nav>
|
93
|
+
|
94
|
+
<main role="main" aria-labelledby="class-Gravaty::Parsers::Rating">
|
95
|
+
<h1 id="class-Gravaty::Parsers::Rating" class="class">
|
96
|
+
class Gravaty::Parsers::Rating
|
97
|
+
</h1>
|
98
|
+
|
99
|
+
<section class="description">
|
100
|
+
|
101
|
+
<p>This class is an implementation of the Parsable duck type that checks the rating type. The only needed parameter is a valid rating type.</p>
|
102
|
+
<dl class="rdoc-list note-list"><dt>Author
|
103
|
+
<dd>
|
104
|
+
<p><a href="mailto:marcobresciani_1974@libero.it">Marco Bresciani</a></p>
|
105
|
+
</dd><dt>Copyright
|
106
|
+
<dd>
|
107
|
+
<p>Copyright © 2013, 2014, 2015, 2016, 2017, 2018,</p>
|
108
|
+
</dd></dl>
|
109
|
+
|
110
|
+
<p>2019 Marco Bresciani</p>
|
111
|
+
<dl class="rdoc-list note-list"><dt>License
|
112
|
+
<dd>
|
113
|
+
<p>GNU General Public License version 3</p>
|
114
|
+
</dd></dl>
|
115
|
+
|
116
|
+
</section>
|
117
|
+
|
118
|
+
|
119
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
130
|
+
<header>
|
131
|
+
<h3>Public Instance Methods</h3>
|
132
|
+
</header>
|
133
|
+
|
134
|
+
|
135
|
+
<div id="method-i-parse" class="method-detail ">
|
136
|
+
|
137
|
+
<div class="method-heading">
|
138
|
+
<span class="method-name">parse</span><span
|
139
|
+
class="method-args">(value = nil)</span>
|
140
|
+
|
141
|
+
<span class="method-click-advice">click to toggle source</span>
|
142
|
+
|
143
|
+
</div>
|
144
|
+
|
145
|
+
|
146
|
+
<div class="method-description">
|
147
|
+
|
148
|
+
<p>the parsable duck type interface to every parser usage.</p>
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
<div class="method-source-code" id="parse-source">
|
154
|
+
<pre> <span class="ruby-comment"># File lib/gravaty/parsers/rating.rb</span>
|
155
|
+
<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>)
|
156
|
+
<span class="line-num">40</span> <span class="ruby-identifier">raiser_downcase</span>(<span class="ruby-string">'error.value'</span>, <span class="ruby-identifier">value</span>, <span class="ruby-constant">RATING_OPTIONS</span>)
|
157
|
+
<span class="line-num">41</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">?</span> <span class="ruby-string">''</span> <span class="ruby-operator">:</span> <span class="ruby-node">"rating=#{value.downcase.to_s}"</span>
|
158
|
+
<span class="line-num">42</span> <span class="ruby-keyword">end</span></pre>
|
159
|
+
</div>
|
160
|
+
|
161
|
+
</div>
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
</div>
|
167
|
+
|
168
|
+
|
169
|
+
</section>
|
170
|
+
|
171
|
+
</section>
|
172
|
+
|
173
|
+
</main>
|
174
|
+
|
175
|
+
|
176
|
+
<footer id="validator-badges" role="contentinfo">
|
177
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
178
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.1.1.
|
179
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
180
|
+
</footer>
|
181
|
+
|