coded_attribute 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest +8 -29
- data/README +83 -7
- data/README.rdoc +89 -0
- data/Rakefile +4 -3
- data/coded_attribute.gemspec +12 -6
- data/lib/coded_attribute.rb +19 -23
- data/rdoc/classes/CodedAttribute.html +167 -0
- data/rdoc/created.rid +1 -3
- data/rdoc/files/README.html +212 -0
- data/rdoc/files/lib/coded_attribute_rb.html +107 -0
- data/rdoc/fr_class_index.html +27 -0
- data/rdoc/fr_file_index.html +28 -0
- data/rdoc/fr_method_index.html +27 -0
- data/rdoc/index.html +20 -54
- data/rdoc/rdoc-style.css +208 -0
- metadata +51 -36
- data/rdoc/CodedAttributes.html +0 -226
- data/rdoc/README.html +0 -96
- data/rdoc/images/brick.png +0 -0
- data/rdoc/images/brick_link.png +0 -0
- data/rdoc/images/bug.png +0 -0
- data/rdoc/images/bullet_black.png +0 -0
- data/rdoc/images/bullet_toggle_minus.png +0 -0
- data/rdoc/images/bullet_toggle_plus.png +0 -0
- data/rdoc/images/date.png +0 -0
- data/rdoc/images/find.png +0 -0
- data/rdoc/images/loadingAnimation.gif +0 -0
- data/rdoc/images/macFFBgHack.png +0 -0
- data/rdoc/images/package.png +0 -0
- data/rdoc/images/page_green.png +0 -0
- data/rdoc/images/page_white_text.png +0 -0
- data/rdoc/images/page_white_width.png +0 -0
- data/rdoc/images/plugin.png +0 -0
- data/rdoc/images/ruby.png +0 -0
- data/rdoc/images/tag_green.png +0 -0
- data/rdoc/images/wrench.png +0 -0
- data/rdoc/images/wrench_orange.png +0 -0
- data/rdoc/images/zoom.png +0 -0
- data/rdoc/js/darkfish.js +0 -116
- data/rdoc/js/jquery.js +0 -32
- data/rdoc/js/quicksearch.js +0 -114
- data/rdoc/js/thickbox-compressed.js +0 -10
- data/rdoc/lib/coded_attributes_rb.html +0 -55
- data/rdoc/rdoc.css +0 -706
data/rdoc/rdoc-style.css
ADDED
@@ -0,0 +1,208 @@
|
|
1
|
+
|
2
|
+
body {
|
3
|
+
font-family: Verdana,Arial,Helvetica,sans-serif;
|
4
|
+
font-size: 90%;
|
5
|
+
margin: 0;
|
6
|
+
margin-left: 40px;
|
7
|
+
padding: 0;
|
8
|
+
background: white;
|
9
|
+
}
|
10
|
+
|
11
|
+
h1,h2,h3,h4 { margin: 0; color: #efefef; background: transparent; }
|
12
|
+
h1 { font-size: 150%; }
|
13
|
+
h2,h3,h4 { margin-top: 1em; }
|
14
|
+
|
15
|
+
a { background: #eef; color: #039; text-decoration: none; }
|
16
|
+
a:hover { background: #039; color: #eef; }
|
17
|
+
|
18
|
+
/* Override the base stylesheet's Anchor inside a table cell */
|
19
|
+
td > a {
|
20
|
+
background: transparent;
|
21
|
+
color: #039;
|
22
|
+
text-decoration: none;
|
23
|
+
}
|
24
|
+
|
25
|
+
/* and inside a section title */
|
26
|
+
.section-title > a {
|
27
|
+
background: transparent;
|
28
|
+
color: #eee;
|
29
|
+
text-decoration: none;
|
30
|
+
}
|
31
|
+
|
32
|
+
/* === Structural elements =================================== */
|
33
|
+
|
34
|
+
div#index {
|
35
|
+
margin: 0;
|
36
|
+
margin-left: -40px;
|
37
|
+
padding: 0;
|
38
|
+
font-size: 90%;
|
39
|
+
}
|
40
|
+
|
41
|
+
|
42
|
+
div#index a {
|
43
|
+
margin-left: 0.7em;
|
44
|
+
}
|
45
|
+
|
46
|
+
div#index .section-bar {
|
47
|
+
margin-left: 0px;
|
48
|
+
padding-left: 0.7em;
|
49
|
+
background: #ccc;
|
50
|
+
font-size: small;
|
51
|
+
}
|
52
|
+
|
53
|
+
|
54
|
+
div#classHeader, div#fileHeader {
|
55
|
+
width: auto;
|
56
|
+
color: white;
|
57
|
+
padding: 0.5em 1.5em 0.5em 1.5em;
|
58
|
+
margin: 0;
|
59
|
+
margin-left: -40px;
|
60
|
+
border-bottom: 3px solid #006;
|
61
|
+
}
|
62
|
+
|
63
|
+
div#classHeader a, div#fileHeader a {
|
64
|
+
background: inherit;
|
65
|
+
color: white;
|
66
|
+
}
|
67
|
+
|
68
|
+
div#classHeader td, div#fileHeader td {
|
69
|
+
background: inherit;
|
70
|
+
color: white;
|
71
|
+
}
|
72
|
+
|
73
|
+
|
74
|
+
div#fileHeader {
|
75
|
+
background: #057;
|
76
|
+
}
|
77
|
+
|
78
|
+
div#classHeader {
|
79
|
+
background: #048;
|
80
|
+
}
|
81
|
+
|
82
|
+
|
83
|
+
.class-name-in-header {
|
84
|
+
font-size: 180%;
|
85
|
+
font-weight: bold;
|
86
|
+
}
|
87
|
+
|
88
|
+
|
89
|
+
div#bodyContent {
|
90
|
+
padding: 0 1.5em 0 1.5em;
|
91
|
+
}
|
92
|
+
|
93
|
+
div#description {
|
94
|
+
padding: 0.5em 1.5em;
|
95
|
+
background: #efefef;
|
96
|
+
border: 1px dotted #999;
|
97
|
+
}
|
98
|
+
|
99
|
+
div#description h1,h2,h3,h4,h5,h6 {
|
100
|
+
color: #125;;
|
101
|
+
background: transparent;
|
102
|
+
}
|
103
|
+
|
104
|
+
div#validator-badges {
|
105
|
+
text-align: center;
|
106
|
+
}
|
107
|
+
div#validator-badges img { border: 0; }
|
108
|
+
|
109
|
+
div#copyright {
|
110
|
+
color: #333;
|
111
|
+
background: #efefef;
|
112
|
+
font: 0.75em sans-serif;
|
113
|
+
margin-top: 5em;
|
114
|
+
margin-bottom: 0;
|
115
|
+
padding: 0.5em 2em;
|
116
|
+
}
|
117
|
+
|
118
|
+
|
119
|
+
/* === Classes =================================== */
|
120
|
+
|
121
|
+
table.header-table {
|
122
|
+
color: white;
|
123
|
+
font-size: small;
|
124
|
+
}
|
125
|
+
|
126
|
+
.type-note {
|
127
|
+
font-size: small;
|
128
|
+
color: #DEDEDE;
|
129
|
+
}
|
130
|
+
|
131
|
+
.xxsection-bar {
|
132
|
+
background: #eee;
|
133
|
+
color: #333;
|
134
|
+
padding: 3px;
|
135
|
+
}
|
136
|
+
|
137
|
+
.section-bar {
|
138
|
+
color: #333;
|
139
|
+
border-bottom: 1px solid #999;
|
140
|
+
margin-left: -20px;
|
141
|
+
}
|
142
|
+
|
143
|
+
|
144
|
+
.section-title {
|
145
|
+
background: #79a;
|
146
|
+
color: #eee;
|
147
|
+
padding: 3px;
|
148
|
+
margin-top: 2em;
|
149
|
+
margin-left: -30px;
|
150
|
+
border: 1px solid #999;
|
151
|
+
}
|
152
|
+
|
153
|
+
.top-aligned-row { vertical-align: top }
|
154
|
+
.bottom-aligned-row { vertical-align: bottom }
|
155
|
+
|
156
|
+
/* --- Context section classes ----------------------- */
|
157
|
+
|
158
|
+
.context-row { }
|
159
|
+
.context-item-name { font-family: monospace; font-weight: bold; color: black; }
|
160
|
+
.context-item-value { font-size: small; color: #448; }
|
161
|
+
.context-item-desc { color: #333; padding-left: 2em; }
|
162
|
+
|
163
|
+
/* --- Method classes -------------------------- */
|
164
|
+
.method-detail {
|
165
|
+
background: #efefef;
|
166
|
+
padding: 0;
|
167
|
+
margin-top: 0.5em;
|
168
|
+
margin-bottom: 1em;
|
169
|
+
border: 1px dotted #ccc;
|
170
|
+
}
|
171
|
+
.method-heading {
|
172
|
+
color: black;
|
173
|
+
background: #ccc;
|
174
|
+
border-bottom: 1px solid #666;
|
175
|
+
padding: 0.2em 0.5em 0 0.5em;
|
176
|
+
}
|
177
|
+
.method-signature { color: black; background: inherit; }
|
178
|
+
.method-name { font-weight: bold; }
|
179
|
+
.method-args { font-style: italic; }
|
180
|
+
.method-description { padding: 0 0.5em 0 0.5em; }
|
181
|
+
|
182
|
+
/* --- Source code sections -------------------- */
|
183
|
+
|
184
|
+
a.source-toggle { font-size: 90%; }
|
185
|
+
div.method-source-code {
|
186
|
+
background: #262626;
|
187
|
+
color: #ffdead;
|
188
|
+
margin: 1em;
|
189
|
+
padding: 0.5em;
|
190
|
+
border: 1px dashed #999;
|
191
|
+
overflow: hidden;
|
192
|
+
}
|
193
|
+
|
194
|
+
div.method-source-code pre { color: #ffdead; overflow: hidden; }
|
195
|
+
|
196
|
+
/* --- Ruby keyword styles --------------------- */
|
197
|
+
|
198
|
+
.standalone-code { background: #221111; color: #ffdead; overflow: hidden; }
|
199
|
+
|
200
|
+
.ruby-constant { color: #7fffd4; background: transparent; }
|
201
|
+
.ruby-keyword { color: #00ffff; background: transparent; }
|
202
|
+
.ruby-ivar { color: #eedd82; background: transparent; }
|
203
|
+
.ruby-operator { color: #00ffee; background: transparent; }
|
204
|
+
.ruby-identifier { color: #ffdead; background: transparent; }
|
205
|
+
.ruby-node { color: #ffa07a; background: transparent; }
|
206
|
+
.ruby-comment { color: #b22222; font-weight: bold; background: transparent; }
|
207
|
+
.ruby-regexp { color: #ffa07a; background: transparent; }
|
208
|
+
.ruby-value { color: #7fffd4; background: transparent; }
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coded_attribute
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 23
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Jaden Carver
|
@@ -14,10 +15,41 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-11-
|
18
|
+
date: 2010-11-10 00:00:00 -07:00
|
18
19
|
default_executable:
|
19
|
-
dependencies:
|
20
|
-
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: activerecord
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 7
|
30
|
+
segments:
|
31
|
+
- 3
|
32
|
+
- 0
|
33
|
+
- 0
|
34
|
+
version: 3.0.0
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: activerecord
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 7
|
46
|
+
segments:
|
47
|
+
- 3
|
48
|
+
- 0
|
49
|
+
- 0
|
50
|
+
version: 3.0.0
|
51
|
+
type: :development
|
52
|
+
version_requirements: *id002
|
21
53
|
description: ActiveRecord plugin for storing coded variables
|
22
54
|
email: jaden.carver@gmail.com
|
23
55
|
executables: []
|
@@ -26,51 +58,32 @@ extensions: []
|
|
26
58
|
|
27
59
|
extra_rdoc_files:
|
28
60
|
- README
|
61
|
+
- README.rdoc
|
29
62
|
- lib/coded_attribute.rb
|
30
63
|
files:
|
31
64
|
- MIT-LICENSE
|
32
65
|
- Manifest
|
33
66
|
- README
|
67
|
+
- README.rdoc
|
34
68
|
- Rakefile
|
35
|
-
- coded_attribute.gemspec
|
36
69
|
- init.rb
|
37
70
|
- install.rb
|
38
71
|
- lib/coded_attribute.rb
|
39
|
-
- rdoc/
|
40
|
-
- rdoc/README.html
|
72
|
+
- rdoc/classes/CodedAttribute.html
|
41
73
|
- rdoc/created.rid
|
42
|
-
- rdoc/
|
43
|
-
- rdoc/
|
44
|
-
- rdoc/
|
45
|
-
- rdoc/
|
46
|
-
- rdoc/
|
47
|
-
- rdoc/images/bullet_toggle_plus.png
|
48
|
-
- rdoc/images/date.png
|
49
|
-
- rdoc/images/find.png
|
50
|
-
- rdoc/images/loadingAnimation.gif
|
51
|
-
- rdoc/images/macFFBgHack.png
|
52
|
-
- rdoc/images/package.png
|
53
|
-
- rdoc/images/page_green.png
|
54
|
-
- rdoc/images/page_white_text.png
|
55
|
-
- rdoc/images/page_white_width.png
|
56
|
-
- rdoc/images/plugin.png
|
57
|
-
- rdoc/images/ruby.png
|
58
|
-
- rdoc/images/tag_green.png
|
59
|
-
- rdoc/images/wrench.png
|
60
|
-
- rdoc/images/wrench_orange.png
|
61
|
-
- rdoc/images/zoom.png
|
74
|
+
- rdoc/files/README.html
|
75
|
+
- rdoc/files/lib/coded_attribute_rb.html
|
76
|
+
- rdoc/fr_class_index.html
|
77
|
+
- rdoc/fr_file_index.html
|
78
|
+
- rdoc/fr_method_index.html
|
62
79
|
- rdoc/index.html
|
63
|
-
- rdoc/
|
64
|
-
- rdoc/js/jquery.js
|
65
|
-
- rdoc/js/quicksearch.js
|
66
|
-
- rdoc/js/thickbox-compressed.js
|
67
|
-
- rdoc/lib/coded_attributes_rb.html
|
68
|
-
- rdoc/rdoc.css
|
80
|
+
- rdoc/rdoc-style.css
|
69
81
|
- test/coded_attributes_test.rb
|
70
82
|
- test/test_helper.rb
|
71
83
|
- uninstall.rb
|
84
|
+
- coded_attribute.gemspec
|
72
85
|
has_rdoc: true
|
73
|
-
homepage: http://github.com/
|
86
|
+
homepage: http://github.com/windigo/coded_attribute
|
74
87
|
licenses: []
|
75
88
|
|
76
89
|
post_install_message:
|
@@ -88,6 +101,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
88
101
|
requirements:
|
89
102
|
- - ">="
|
90
103
|
- !ruby/object:Gem::Version
|
104
|
+
hash: 3
|
91
105
|
segments:
|
92
106
|
- 0
|
93
107
|
version: "0"
|
@@ -96,6 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
110
|
requirements:
|
97
111
|
- - ">="
|
98
112
|
- !ruby/object:Gem::Version
|
113
|
+
hash: 11
|
99
114
|
segments:
|
100
115
|
- 1
|
101
116
|
- 2
|
@@ -108,5 +123,5 @@ signing_key:
|
|
108
123
|
specification_version: 3
|
109
124
|
summary: ActiveRecord plugin for storing coded variables
|
110
125
|
test_files:
|
111
|
-
- test/test_helper.rb
|
112
126
|
- test/coded_attributes_test.rb
|
127
|
+
- test/test_helper.rb
|
data/rdoc/CodedAttributes.html
DELETED
@@ -1,226 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
2
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
-
<head>
|
6
|
-
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
7
|
-
|
8
|
-
<title>Module: CodedAttributes</title>
|
9
|
-
|
10
|
-
<link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />
|
11
|
-
|
12
|
-
<script src="./js/jquery.js" type="text/javascript"
|
13
|
-
charset="utf-8"></script>
|
14
|
-
<script src="./js/thickbox-compressed.js" type="text/javascript"
|
15
|
-
charset="utf-8"></script>
|
16
|
-
<script src="./js/quicksearch.js" type="text/javascript"
|
17
|
-
charset="utf-8"></script>
|
18
|
-
<script src="./js/darkfish.js" type="text/javascript"
|
19
|
-
charset="utf-8"></script>
|
20
|
-
|
21
|
-
</head>
|
22
|
-
<body class="module">
|
23
|
-
|
24
|
-
<div id="metadata">
|
25
|
-
<div id="home-metadata">
|
26
|
-
<div id="home-section" class="section">
|
27
|
-
<h3 class="section-header">
|
28
|
-
<a href="./index.html">Home</a>
|
29
|
-
<a href="./index.html#classes">Classes</a>
|
30
|
-
<a href="./index.html#methods">Methods</a>
|
31
|
-
</h3>
|
32
|
-
</div>
|
33
|
-
</div>
|
34
|
-
|
35
|
-
<div id="file-metadata">
|
36
|
-
<div id="file-list-section" class="section">
|
37
|
-
<h3 class="section-header">In Files</h3>
|
38
|
-
<div class="section-body">
|
39
|
-
<ul>
|
40
|
-
|
41
|
-
<li><a href="./lib/coded_attributes_rb.html?TB_iframe=true&height=550&width=785"
|
42
|
-
class="thickbox" title="lib/coded_attributes.rb">lib/coded_attributes.rb</a></li>
|
43
|
-
|
44
|
-
</ul>
|
45
|
-
</div>
|
46
|
-
</div>
|
47
|
-
|
48
|
-
|
49
|
-
</div>
|
50
|
-
|
51
|
-
<div id="class-metadata">
|
52
|
-
|
53
|
-
<!-- Parent Class -->
|
54
|
-
|
55
|
-
|
56
|
-
<!-- Namespace Contents -->
|
57
|
-
|
58
|
-
|
59
|
-
<!-- Method Quickref -->
|
60
|
-
|
61
|
-
<div id="method-list-section" class="section">
|
62
|
-
<h3 class="section-header">Methods</h3>
|
63
|
-
<ul class="link-list">
|
64
|
-
|
65
|
-
<li><a href="#method-i-coded_attribute">#coded_attribute</a></li>
|
66
|
-
|
67
|
-
</ul>
|
68
|
-
</div>
|
69
|
-
|
70
|
-
|
71
|
-
<!-- Included Modules -->
|
72
|
-
|
73
|
-
</div>
|
74
|
-
|
75
|
-
<div id="project-metadata">
|
76
|
-
|
77
|
-
|
78
|
-
<div id="fileindex-section" class="section project-section">
|
79
|
-
<h3 class="section-header">Files</h3>
|
80
|
-
<ul>
|
81
|
-
|
82
|
-
<li class="file"><a href="./README.html">README</a></li>
|
83
|
-
|
84
|
-
</ul>
|
85
|
-
</div>
|
86
|
-
|
87
|
-
|
88
|
-
<div id="classindex-section" class="section project-section">
|
89
|
-
<h3 class="section-header">Class Index
|
90
|
-
<span class="search-toggle"><img src="./images/find.png"
|
91
|
-
height="16" width="16" alt="[+]"
|
92
|
-
title="show/hide quicksearch" /></span></h3>
|
93
|
-
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
94
|
-
<fieldset>
|
95
|
-
<legend>Quicksearch</legend>
|
96
|
-
<input type="text" name="quicksearch" value=""
|
97
|
-
class="quicksearch-field" />
|
98
|
-
</fieldset>
|
99
|
-
</form>
|
100
|
-
|
101
|
-
<ul class="link-list">
|
102
|
-
|
103
|
-
<li><a href="./CodedAttributes.html">CodedAttributes</a></li>
|
104
|
-
|
105
|
-
</ul>
|
106
|
-
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
107
|
-
</div>
|
108
|
-
|
109
|
-
|
110
|
-
</div>
|
111
|
-
</div>
|
112
|
-
|
113
|
-
<div id="documentation">
|
114
|
-
<h1 class="module">CodedAttributes</h1>
|
115
|
-
|
116
|
-
<div id="description">
|
117
|
-
<p>
|
118
|
-
<a href="CodedAttributes.html">CodedAttributes</a>
|
119
|
-
</p>
|
120
|
-
|
121
|
-
</div>
|
122
|
-
|
123
|
-
<!-- Constants -->
|
124
|
-
|
125
|
-
<div id="constants-list" class="section">
|
126
|
-
<h3 class="section-header">Constants</h3>
|
127
|
-
<dl>
|
128
|
-
|
129
|
-
<dt><a name="VERSION">VERSION</a></dt>
|
130
|
-
|
131
|
-
<dd class="description"></dd>
|
132
|
-
|
133
|
-
|
134
|
-
</dl>
|
135
|
-
</div>
|
136
|
-
|
137
|
-
|
138
|
-
<!-- Attributes -->
|
139
|
-
|
140
|
-
|
141
|
-
<!-- Methods -->
|
142
|
-
|
143
|
-
<div id="public-instance-method-details" class="method-section section">
|
144
|
-
<h3 class="section-header">Public Instance Methods</h3>
|
145
|
-
|
146
|
-
|
147
|
-
<div id="coded-attribute-method" class="method-detail ">
|
148
|
-
<a name="method-i-coded_attribute"></a>
|
149
|
-
|
150
|
-
<div class="method-heading">
|
151
|
-
|
152
|
-
<span class="method-name">coded_attribute</span><span
|
153
|
-
class="method-args">(method, *attribute_or_codes)</span>
|
154
|
-
<span class="method-click-advice">click to toggle source</span>
|
155
|
-
|
156
|
-
</div>
|
157
|
-
|
158
|
-
<div class="method-description">
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
<div class="method-source-code"
|
165
|
-
id="coded-attribute-source">
|
166
|
-
<pre>
|
167
|
-
<span class="ruby-comment cmt"># File lib/coded_attributes.rb, line 6</span>
|
168
|
-
6: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">coded_attribute</span>(<span class="ruby-identifier">method</span>, *<span class="ruby-identifier">attribute_or_codes</span>)
|
169
|
-
7: <span class="ruby-keyword kw">if</span> [<span class="ruby-constant">String</span>,<span class="ruby-constant">Symbol</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">attribute_or_codes</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">class</span>)
|
170
|
-
8: <span class="ruby-identifier">attribute</span> = <span class="ruby-identifier">attribute_or_codes</span>.<span class="ruby-identifier">shift</span>
|
171
|
-
9: <span class="ruby-keyword kw">else</span>
|
172
|
-
10: <span class="ruby-identifier">attribute</span> = <span class="ruby-value">:"#{method}_code"</span>
|
173
|
-
11: <span class="ruby-keyword kw">end</span>
|
174
|
-
12:
|
175
|
-
13: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">attribute_or_codes</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Hash</span>
|
176
|
-
14: <span class="ruby-identifier">codes</span> = <span class="ruby-identifier">attribute_or_codes</span>.<span class="ruby-identifier">shift</span>
|
177
|
-
15: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">"Too many arguments"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">attribute_or_codes</span>.<span class="ruby-identifier">blank?</span>
|
178
|
-
16: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">attribute_or_codes</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Array</span>
|
179
|
-
17: <span class="ruby-identifier">codes</span> = <span class="ruby-identifier">attribute_or_codes</span>.<span class="ruby-identifier">shift</span>.<span class="ruby-identifier">inject</span>({}) { <span class="ruby-operator">|</span><span class="ruby-identifier">h</span>, <span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>.<span class="ruby-identifier">merge!</span> <span class="ruby-identifier">h</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">count</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">v</span> }
|
180
|
-
18: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">"Too many arguments"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">attribute_or_codes</span>.<span class="ruby-identifier">blank?</span>
|
181
|
-
19: <span class="ruby-keyword kw">else</span>
|
182
|
-
20: <span class="ruby-identifier">codes</span> = <span class="ruby-identifier">attribute_or_codes</span>.<span class="ruby-identifier">inject</span>({}) { <span class="ruby-operator">|</span><span class="ruby-identifier">h</span>, <span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>.<span class="ruby-identifier">merge!</span> <span class="ruby-identifier">h</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">count</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">v</span> }
|
183
|
-
21: <span class="ruby-keyword kw">end</span>
|
184
|
-
22:
|
185
|
-
23: <span class="ruby-identifier">class_variable_set</span> <span class="ruby-value">:"@@#{method}_codes"</span>, <span class="ruby-identifier">codes</span>
|
186
|
-
24: <span class="ruby-identifier">cattr_reader</span> <span class="ruby-value">:"#{method}_codes"</span>
|
187
|
-
25:
|
188
|
-
26: <span class="ruby-identifier">define_method</span> <span class="ruby-value">:"#{method}"</span> <span class="ruby-keyword kw">do</span>
|
189
|
-
27: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">class_variable_get</span>(<span class="ruby-node">"@@#{method}_codes"</span>)[<span class="ruby-identifier">read_attribute</span>(<span class="ruby-identifier">attribute</span>)]
|
190
|
-
28: <span class="ruby-keyword kw">end</span>
|
191
|
-
29:
|
192
|
-
30: <span class="ruby-identifier">define_method</span> <span class="ruby-value">:"#{method}="</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
|
193
|
-
31: <span class="ruby-identifier">write_attribute</span>(<span class="ruby-identifier">attribute</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">class_variable_get</span>(<span class="ruby-node">"@@#{method}_codes"</span>).<span class="ruby-identifier">key</span>(<span class="ruby-identifier">value</span>.<span class="ruby-identifier">to_sym</span>))
|
194
|
-
32: <span class="ruby-keyword kw">end</span>
|
195
|
-
33: <span class="ruby-keyword kw">end</span></pre>
|
196
|
-
</div>
|
197
|
-
|
198
|
-
</div>
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
</div>
|
204
|
-
|
205
|
-
|
206
|
-
</div>
|
207
|
-
|
208
|
-
|
209
|
-
</div>
|
210
|
-
|
211
|
-
|
212
|
-
<div id="rdoc-debugging-section-dump" class="debugging-section">
|
213
|
-
|
214
|
-
<p>Disabled; run with --debug to generate this.</p>
|
215
|
-
|
216
|
-
</div>
|
217
|
-
|
218
|
-
<div id="validator-badges">
|
219
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
220
|
-
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
221
|
-
Rdoc Generator</a> 1.1.6</small>.</p>
|
222
|
-
</div>
|
223
|
-
|
224
|
-
</body>
|
225
|
-
</html>
|
226
|
-
|