attrtastic 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/attrtastic.gemspec +1 -1
- data/doc/Attrtastic/SemanticAttributesBuilder.html +326 -108
- data/doc/Attrtastic/SemanticAttributesHelper.html +11 -11
- data/doc/Attrtastic.html +1 -1
- data/doc/_index.html +1 -1
- data/doc/file.README.html +1 -1
- data/doc/index.html +1 -1
- data/doc/top-level-namespace.html +1 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/attrtastic.gemspec
CHANGED
@@ -359,6 +359,8 @@ Only for testing purposes
|
|
359
359
|
|
360
360
|
<span class="overload">- (<tt>Object</tt>) <strong>attribute</strong>(method, options = {}, &block) { ... }</span>
|
361
361
|
|
362
|
+
<span class="overload">- (<tt>Object</tt>) <strong>attribute</strong>(options = {}, &block) { ... }</span>
|
363
|
+
|
362
364
|
|
363
365
|
|
364
366
|
|
@@ -380,7 +382,7 @@ Creates list entry for single record attribute
|
|
380
382
|
<pre class="example code"> <%= attr.attribute :name, :display_empty => true %></pre>
|
381
383
|
|
382
384
|
<h4></h4>
|
383
|
-
<pre class="example code"> <% attr.attribute :
|
385
|
+
<pre class="example code"> <% attr.attribute :label => "User link" do %>
|
384
386
|
<%= link_to @user.full_name, user_path(@user) %></pre>
|
385
387
|
|
386
388
|
</div>
|
@@ -463,7 +465,7 @@ Options
|
|
463
465
|
<ul class="option">
|
464
466
|
|
465
467
|
<li>
|
466
|
-
<span class="type">(<tt>
|
468
|
+
<span class="type">(<tt>Hash</tt>)</span>
|
467
469
|
<span class="name">:html</span>
|
468
470
|
<span class="default">
|
469
471
|
|
@@ -548,10 +550,6 @@ Creates entry for attribute given with block
|
|
548
550
|
<pre class="example code"> <% attr.attribute :name do %>
|
549
551
|
<%= link_to @user.full_name, user_path(@user) %></pre>
|
550
552
|
|
551
|
-
<h4></h4>
|
552
|
-
<pre class="example code"> <% attr.attribute :name, :label => "User link" do %>
|
553
|
-
<%= link_to @user.full_name, user_path(@user) %></pre>
|
554
|
-
|
555
553
|
</div>
|
556
554
|
<h3>Parameters:</h3>
|
557
555
|
<ul class="param">
|
@@ -601,7 +599,7 @@ Options
|
|
601
599
|
<ul class="option">
|
602
600
|
|
603
601
|
<li>
|
604
|
-
<span class="type">(<tt>
|
602
|
+
<span class="type">(<tt>Hash</tt>)</span>
|
605
603
|
<span class="name">:html</span>
|
606
604
|
<span class="default">
|
607
605
|
|
@@ -610,8 +608,8 @@ Options
|
|
610
608
|
|
611
609
|
</span>
|
612
610
|
—
|
613
|
-
|
614
|
-
html
|
611
|
+
Hash with optional :class, :label_class and :value_class names of classes
|
612
|
+
for html
|
615
613
|
|
616
614
|
|
617
615
|
</tr>
|
@@ -630,17 +628,110 @@ Label for attribute entry, overrides default label name from symbol
|
|
630
628
|
|
631
629
|
</tr>
|
632
630
|
|
631
|
+
</ul>
|
632
|
+
|
633
|
+
|
634
|
+
|
635
|
+
<h3>Yields:</h3>
|
636
|
+
<ul class="yield">
|
637
|
+
|
638
|
+
<li>
|
639
|
+
|
640
|
+
<span class='type'></span>
|
641
|
+
|
642
|
+
|
643
|
+
|
644
|
+
|
645
|
+
|
646
|
+
|
647
|
+
Block which is executed in place of value for attribute
|
648
|
+
|
649
|
+
|
650
|
+
|
651
|
+
</li>
|
652
|
+
|
653
|
+
</ul>
|
654
|
+
|
655
|
+
</div>
|
656
|
+
</li>
|
657
|
+
|
658
|
+
|
659
|
+
<li class="overload_item">
|
660
|
+
<span class="signature">- (<tt>Object</tt>) <strong>attribute</strong>(options = {}, &block) { ... }</span>
|
661
|
+
<div class="docstring">
|
662
|
+
<div class="discussion">
|
663
|
+
<p>
|
664
|
+
Creates entry for attribute with given block, options[:label] is mandatory
|
665
|
+
in this case.
|
666
|
+
</p>
|
667
|
+
|
668
|
+
|
669
|
+
</div>
|
670
|
+
</div>
|
671
|
+
<div class="tags">
|
672
|
+
|
673
|
+
<div class="examples">
|
674
|
+
<h3>Examples:</h3>
|
675
|
+
|
676
|
+
<h4></h4>
|
677
|
+
<pre class="example code"> <% attr.attribute :label => "User link" do %>
|
678
|
+
<%= link_to @user.full_name, user_path(@user) %></pre>
|
679
|
+
|
680
|
+
</div>
|
681
|
+
<h3>Parameters:</h3>
|
682
|
+
<ul class="param">
|
683
|
+
|
684
|
+
<li>
|
685
|
+
|
686
|
+
<span class='type'>(<tt>:Hash</tt>)</span>
|
687
|
+
|
688
|
+
|
689
|
+
<span class='name'>options</span>
|
690
|
+
|
691
|
+
|
692
|
+
|
693
|
+
—
|
694
|
+
|
695
|
+
Options
|
696
|
+
|
697
|
+
|
698
|
+
|
699
|
+
</li>
|
700
|
+
|
701
|
+
</ul>
|
702
|
+
|
703
|
+
|
704
|
+
|
705
|
+
|
706
|
+
<h3>Options Hash (<tt>options</tt>):</h3>
|
707
|
+
<ul class="option">
|
708
|
+
|
633
709
|
<li>
|
634
|
-
<span class="type">(<tt>
|
635
|
-
<span class="name">:
|
710
|
+
<span class="type">(<tt>Hash</tt>)</span>
|
711
|
+
<span class="name">:html</span>
|
636
712
|
<span class="default">
|
637
713
|
|
638
714
|
— default:
|
639
|
-
<tt>
|
715
|
+
<tt>{}</tt>
|
640
716
|
|
641
717
|
</span>
|
642
718
|
—
|
643
|
-
|
719
|
+
Hash with optional :class, :label_class and :value_class names of classes
|
720
|
+
for html
|
721
|
+
|
722
|
+
|
723
|
+
</tr>
|
724
|
+
|
725
|
+
<li>
|
726
|
+
<span class="type">(<tt>String</tt>)</span>
|
727
|
+
<span class="name">:label</span>
|
728
|
+
<span class="default">
|
729
|
+
|
730
|
+
<span class="na">N/A</span>
|
731
|
+
|
732
|
+
</span>
|
733
|
+
—
|
734
|
+
Mandatory label for attribute entry
|
644
735
|
|
645
736
|
|
646
737
|
</tr>
|
@@ -680,43 +771,43 @@ Block which is executed in place of value for attribute
|
|
680
771
|
<pre class="lines">
|
681
772
|
|
682
773
|
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
774
|
+
261
|
775
|
+
262
|
776
|
+
263
|
777
|
+
264
|
778
|
+
265
|
779
|
+
266
|
780
|
+
267
|
781
|
+
268
|
782
|
+
269
|
783
|
+
270
|
784
|
+
271
|
785
|
+
272
|
786
|
+
273
|
787
|
+
274
|
788
|
+
275
|
789
|
+
276
|
790
|
+
277
|
791
|
+
278
|
792
|
+
279
|
793
|
+
280
|
794
|
+
281
|
795
|
+
282
|
796
|
+
283
|
797
|
+
284
|
798
|
+
285
|
799
|
+
286
|
800
|
+
287
|
801
|
+
288
|
802
|
+
289
|
803
|
+
290
|
804
|
+
291
|
805
|
+
292
|
806
|
+
293
|
807
|
+
294</pre>
|
717
808
|
</td>
|
718
809
|
<td>
|
719
|
-
<pre class="code"><span class="info file"># File 'lib/attrtastic.rb', line
|
810
|
+
<pre class="code"><span class="info file"># File 'lib/attrtastic.rb', line 261</span>
|
720
811
|
|
721
812
|
<span class='kw'>def</span> <span class='id attribute'>attribute</span><span class='lparen'>(</span><span class='op'>*</span><span class='id args'>args</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span><span class='rparen'>)</span>
|
722
813
|
<span class='id options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
@@ -763,7 +854,7 @@ Block which is executed in place of value for attribute
|
|
763
854
|
|
764
855
|
<span class="overload">- (<tt>Object</tt>) <strong>attributes</strong>(options = {}, &block) { ... }</span>
|
765
856
|
|
766
|
-
<span class="overload">- (<tt>Object</tt>) <strong>attributes</strong>(header, options = {}, &block) { ... }</span>
|
857
|
+
<span class="overload">- (<tt>Object</tt>) <strong>attributes</strong>(header, options = {}, &block) {|builderBuilderinstanceholdingactualrecord| ... }</span>
|
767
858
|
|
768
859
|
<span class="overload">- (<tt>Object</tt>) <strong>attributes</strong>(*symbols, options = {}) </span>
|
769
860
|
|
@@ -831,6 +922,42 @@ attribute
|
|
831
922
|
<%= attr.attribute :email %>
|
832
923
|
<% end %></pre>
|
833
924
|
|
925
|
+
<h4></h4>
|
926
|
+
<pre class="example code"> <% attr.attributes :name => "User" do %>
|
927
|
+
<%= attr.attribute :name %>
|
928
|
+
<%= attr.attribute :email %>
|
929
|
+
<% end %></pre>
|
930
|
+
|
931
|
+
<h4></h4>
|
932
|
+
<pre class="example code"> <% attr.attributes :for => :user do |user| %>
|
933
|
+
<%= user.attribute :name %>
|
934
|
+
<%= user.attribute :email %>
|
935
|
+
<% user.attribute :profile do %>
|
936
|
+
<%= link_to h(user.record.name), user_path(user.record) %>
|
937
|
+
<% end %>
|
938
|
+
<% end %></pre>
|
939
|
+
|
940
|
+
<h4></h4>
|
941
|
+
<pre class="example code"> <% attr.attributes :for => @user do |user| %>
|
942
|
+
<%= user.attribute :name %>
|
943
|
+
<%= user.attribute :email %>
|
944
|
+
<% user.attribute :profile do %>
|
945
|
+
<%= link_to h(@user.name), user_path(@user) %>
|
946
|
+
<% end %>
|
947
|
+
<% end %></pre>
|
948
|
+
|
949
|
+
<h4></h4>
|
950
|
+
<pre class="example code"> <% attr.attributes :for => :posts do |post| %>
|
951
|
+
<%= post.attribute :author %>
|
952
|
+
<%= post.attribute :title %>
|
953
|
+
<% end %></pre>
|
954
|
+
|
955
|
+
<h4></h4>
|
956
|
+
<pre class="example code"> <% attr.attributes :for => @posts do |post| %>
|
957
|
+
<%= post.attribute :author %>
|
958
|
+
<%= post.attribute :title %>
|
959
|
+
<% end %></pre>
|
960
|
+
|
834
961
|
</div>
|
835
962
|
<h3>Parameters:</h3>
|
836
963
|
<ul class="param">
|
@@ -860,6 +987,21 @@ Options for formating attributes block
|
|
860
987
|
<h3>Options Hash (<tt>options</tt>):</h3>
|
861
988
|
<ul class="option">
|
862
989
|
|
990
|
+
<li>
|
991
|
+
<span class="type">(<tt>String</tt>)</span>
|
992
|
+
<span class="name">:name</span>
|
993
|
+
<span class="default">
|
994
|
+
|
995
|
+
— default:
|
996
|
+
<tt>nil</tt>
|
997
|
+
|
998
|
+
</span>
|
999
|
+
—
|
1000
|
+
Optional header of attributes section
|
1001
|
+
|
1002
|
+
|
1003
|
+
</tr>
|
1004
|
+
|
863
1005
|
<li>
|
864
1006
|
<span class="type">(<tt>String</tt>)</span>
|
865
1007
|
<span class="name">:class</span>
|
@@ -870,7 +1012,7 @@ Options for formating attributes block
|
|
870
1012
|
|
871
1013
|
</span>
|
872
1014
|
—
|
873
|
-
Name of html class
|
1015
|
+
Name of html class to add to attributes block
|
874
1016
|
|
875
1017
|
|
876
1018
|
</tr>
|
@@ -885,7 +1027,7 @@ Name of html class(-es) to add to attributes block
|
|
885
1027
|
|
886
1028
|
</span>
|
887
1029
|
—
|
888
|
-
Name of html class
|
1030
|
+
Name of html class to add to header
|
889
1031
|
|
890
1032
|
|
891
1033
|
</tr>
|
@@ -919,7 +1061,7 @@ Block which can call #attribute to include attribute value
|
|
919
1061
|
|
920
1062
|
|
921
1063
|
<li class="overload_item">
|
922
|
-
<span class="signature">- (<tt>Object</tt>) <strong>attributes</strong>(header, options = {}, &block) { ... }</span>
|
1064
|
+
<span class="signature">- (<tt>Object</tt>) <strong>attributes</strong>(header, options = {}, &block) {|builderBuilderinstanceholdingactualrecord| ... }</span>
|
923
1065
|
<div class="docstring">
|
924
1066
|
<div class="discussion">
|
925
1067
|
<p>
|
@@ -941,6 +1083,36 @@ attribute
|
|
941
1083
|
<%= attr.attribute :email %>
|
942
1084
|
<% end %></pre>
|
943
1085
|
|
1086
|
+
<h4></h4>
|
1087
|
+
<pre class="example code"> <% attr.attributes "User", :for => :user do |user| %>
|
1088
|
+
<%= user.attribute :name %>
|
1089
|
+
<%= user.attribute :email %>
|
1090
|
+
<% user.attribute :profile do %>
|
1091
|
+
<%= link_to h(user.record.name), user_path(user.record) %>
|
1092
|
+
<% end %>
|
1093
|
+
<% end %></pre>
|
1094
|
+
|
1095
|
+
<h4></h4>
|
1096
|
+
<pre class="example code"> <% attr.attributes "User", :for => @user do |user| %>
|
1097
|
+
<%= user.attribute :name %>
|
1098
|
+
<%= user.attribute :email %>
|
1099
|
+
<% user.attribute :profile do %>
|
1100
|
+
<%= link_to h(@user.name), user_path(@user) %>
|
1101
|
+
<% end %>
|
1102
|
+
<% end %></pre>
|
1103
|
+
|
1104
|
+
<h4></h4>
|
1105
|
+
<pre class="example code"> <% attr.attributes "Post", :for => :posts do |post| %>
|
1106
|
+
<%= post.attribute :author %>
|
1107
|
+
<%= post.attribute :title %>
|
1108
|
+
<% end %></pre>
|
1109
|
+
|
1110
|
+
<h4></h4>
|
1111
|
+
<pre class="example code"> <% attr.attributes "Post", :for => @posts do |post| %>
|
1112
|
+
<%= post.attribute :author %>
|
1113
|
+
<%= post.attribute :title %>
|
1114
|
+
<% end %></pre>
|
1115
|
+
|
944
1116
|
</div>
|
945
1117
|
<h3>Parameters:</h3>
|
946
1118
|
<ul class="param">
|
@@ -999,7 +1171,7 @@ Options for formating attributes block
|
|
999
1171
|
|
1000
1172
|
</span>
|
1001
1173
|
—
|
1002
|
-
Name of html class
|
1174
|
+
Name of html class to add to attributes block
|
1003
1175
|
|
1004
1176
|
|
1005
1177
|
</tr>
|
@@ -1014,7 +1186,7 @@ Name of html class(-es) to add to attributes block
|
|
1014
1186
|
|
1015
1187
|
</span>
|
1016
1188
|
—
|
1017
|
-
Name of html class
|
1189
|
+
Name of html class to add to header
|
1018
1190
|
|
1019
1191
|
|
1020
1192
|
</tr>
|
@@ -1039,6 +1211,21 @@ Block which can call #attribute to include attribute value
|
|
1039
1211
|
|
1040
1212
|
|
1041
1213
|
|
1214
|
+
</li>
|
1215
|
+
|
1216
|
+
</ul>
|
1217
|
+
<h3>Yield Parameters:</h3>
|
1218
|
+
<ul class="yieldparam">
|
1219
|
+
|
1220
|
+
<li>
|
1221
|
+
|
1222
|
+
<span class='type'>(<tt>retivable via #record</tt>)</span>
|
1223
|
+
|
1224
|
+
|
1225
|
+
<span class='name'>builderBuilderinstanceholdingactualrecord</span>
|
1226
|
+
|
1227
|
+
|
1228
|
+
|
1042
1229
|
</li>
|
1043
1230
|
|
1044
1231
|
</ul>
|
@@ -1067,6 +1254,18 @@ symbols (record properties)
|
|
1067
1254
|
<h4></h4>
|
1068
1255
|
<pre class="example code"> <% attr.attributes :name, :email %></pre>
|
1069
1256
|
|
1257
|
+
<h4></h4>
|
1258
|
+
<pre class="example code"> <% attr.attributes :name, :email, :for => :author %></pre>
|
1259
|
+
|
1260
|
+
<h4></h4>
|
1261
|
+
<pre class="example code"> <% attr.attributes :name, :email, :for => @user %></pre>
|
1262
|
+
|
1263
|
+
<h4></h4>
|
1264
|
+
<pre class="example code"> <% attr.attributes :title, :for => :posts %></pre>
|
1265
|
+
|
1266
|
+
<h4></h4>
|
1267
|
+
<pre class="example code"> <% attr.attributes :title, :for => @posts %></pre>
|
1268
|
+
|
1070
1269
|
</div>
|
1071
1270
|
<h3>Parameters:</h3>
|
1072
1271
|
<ul class="param">
|
@@ -1115,6 +1314,21 @@ Options for formating attributes block
|
|
1115
1314
|
<h3>Options Hash (<tt>options</tt>):</h3>
|
1116
1315
|
<ul class="option">
|
1117
1316
|
|
1317
|
+
<li>
|
1318
|
+
<span class="type">(<tt>String</tt>)</span>
|
1319
|
+
<span class="name">:name</span>
|
1320
|
+
<span class="default">
|
1321
|
+
|
1322
|
+
— default:
|
1323
|
+
<tt>nil</tt>
|
1324
|
+
|
1325
|
+
</span>
|
1326
|
+
—
|
1327
|
+
Optional header of attributes section
|
1328
|
+
|
1329
|
+
|
1330
|
+
</tr>
|
1331
|
+
|
1118
1332
|
<li>
|
1119
1333
|
<span class="type">(<tt>String</tt>)</span>
|
1120
1334
|
<span class="name">:class</span>
|
@@ -1125,7 +1339,7 @@ Options for formating attributes block
|
|
1125
1339
|
|
1126
1340
|
</span>
|
1127
1341
|
—
|
1128
|
-
Name of html class
|
1342
|
+
Name of html class to add to attributes block
|
1129
1343
|
|
1130
1344
|
|
1131
1345
|
</tr>
|
@@ -1140,7 +1354,7 @@ Name of html class(-es) to add to attributes block
|
|
1140
1354
|
|
1141
1355
|
</span>
|
1142
1356
|
—
|
1143
|
-
Name of html class
|
1357
|
+
Name of html class to add to header
|
1144
1358
|
|
1145
1359
|
|
1146
1360
|
</tr>
|
@@ -1172,6 +1386,18 @@ symbols (record properties)
|
|
1172
1386
|
<h4></h4>
|
1173
1387
|
<pre class="example code"> <% attr.attributes "User info" :name, :email %></pre>
|
1174
1388
|
|
1389
|
+
<h4></h4>
|
1390
|
+
<pre class="example code"> <% attr.attributes "Author", :name, :email, :for => :author %></pre>
|
1391
|
+
|
1392
|
+
<h4></h4>
|
1393
|
+
<pre class="example code"> <% attr.attributes "Author", :name, :email, :for => @user %></pre>
|
1394
|
+
|
1395
|
+
<h4></h4>
|
1396
|
+
<pre class="example code"> <% attr.attributes "Post", :title, :for => :posts %></pre>
|
1397
|
+
|
1398
|
+
<h4></h4>
|
1399
|
+
<pre class="example code"> <% attr.attributes "Post", :title, :for => @posts %></pre>
|
1400
|
+
|
1175
1401
|
</div>
|
1176
1402
|
<h3>Parameters:</h3>
|
1177
1403
|
<ul class="param">
|
@@ -1249,7 +1475,7 @@ Options for formating attributes block
|
|
1249
1475
|
|
1250
1476
|
</span>
|
1251
1477
|
—
|
1252
|
-
Name of html class
|
1478
|
+
Name of html class to add to attributes block
|
1253
1479
|
|
1254
1480
|
|
1255
1481
|
</tr>
|
@@ -1264,7 +1490,7 @@ Name of html class(-es) to add to attributes block
|
|
1264
1490
|
|
1265
1491
|
</span>
|
1266
1492
|
—
|
1267
|
-
Name of html class
|
1493
|
+
Name of html class to add to header
|
1268
1494
|
|
1269
1495
|
|
1270
1496
|
</tr>
|
@@ -1290,40 +1516,36 @@ Name of html class(-es) to add to header
|
|
1290
1516
|
<pre class="lines">
|
1291
1517
|
|
1292
1518
|
|
1293
|
-
|
1294
|
-
|
1295
|
-
|
1296
|
-
|
1297
|
-
|
1298
|
-
|
1299
|
-
|
1300
|
-
|
1301
|
-
|
1302
|
-
|
1303
|
-
|
1304
|
-
|
1305
|
-
|
1306
|
-
|
1307
|
-
|
1308
|
-
|
1309
|
-
|
1310
|
-
|
1311
|
-
|
1312
|
-
|
1313
|
-
|
1314
|
-
|
1315
|
-
|
1316
|
-
|
1317
|
-
|
1318
|
-
|
1319
|
-
|
1320
|
-
110
|
1321
|
-
111
|
1322
|
-
112
|
1323
|
-
113</pre>
|
1519
|
+
179
|
1520
|
+
180
|
1521
|
+
181
|
1522
|
+
182
|
1523
|
+
183
|
1524
|
+
184
|
1525
|
+
185
|
1526
|
+
186
|
1527
|
+
187
|
1528
|
+
188
|
1529
|
+
189
|
1530
|
+
190
|
1531
|
+
191
|
1532
|
+
192
|
1533
|
+
193
|
1534
|
+
194
|
1535
|
+
195
|
1536
|
+
196
|
1537
|
+
197
|
1538
|
+
198
|
1539
|
+
199
|
1540
|
+
200
|
1541
|
+
201
|
1542
|
+
202
|
1543
|
+
203
|
1544
|
+
204
|
1545
|
+
205</pre>
|
1324
1546
|
</td>
|
1325
1547
|
<td>
|
1326
|
-
<pre class="code"><span class="info file"># File 'lib/attrtastic.rb', line
|
1548
|
+
<pre class="code"><span class="info file"># File 'lib/attrtastic.rb', line 179</span>
|
1327
1549
|
|
1328
1550
|
<span class='kw'>def</span> <span class='id attributes'>attributes</span><span class='lparen'>(</span><span class='op'>*</span><span class='id args'>args</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span><span class='rparen'>)</span>
|
1329
1551
|
<span class='id options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
@@ -1333,28 +1555,24 @@ Name of html class(-es) to add to header
|
|
1333
1555
|
<span class='kw'>end</span>
|
1334
1556
|
<span class='id options'>options</span><span class='lbracket'>[</span><span class='symbol'>:html</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
1335
1557
|
|
1336
|
-
<span class='id html_class'>html_class</span> <span class='op'>=</span> <span class='lbracket'>[</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>attributes</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='symbol'>:html</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:class</span><span class='rparen'>)</span> <span class='rbracket'>]</span><span class='period'>.</span><span class='id compact'>compact</span><span class='period'>.</span><span class='id join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> </span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
1337
|
-
<span class='id html_header_class'>html_header_class</span> <span class='op'>=</span> <span class='lbracket'>[</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>legend</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='symbol'>:html</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:header_class</span><span class='rparen'>)</span> <span class='rbracket'>]</span><span class='period'>.</span><span class='id compact'>compact</span><span class='period'>.</span><span class='id join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> </span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
1338
|
-
|
1339
|
-
<span class='id template'>template</span><span class='period'>.</span><span class='id concat'>concat</span><span class='lparen'>(</span><span class='id template'>template</span><span class='period'>.</span><span class='id tag'>tag</span><span class='lparen'>(</span><span class='symbol'>:div</span><span class='comma'>,</span> <span class='lbrace'>{</span><span class='symbol'>:class</span> <span class='op'>=></span> <span class='id html_class'>html_class</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='kw'>true</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
1340
|
-
|
1341
1558
|
<span class='kw'>if</span> <span class='id args'>args</span><span class='period'>.</span><span class='id first'>first</span> <span class='kw'>and</span> <span class='id args'>args</span><span class='period'>.</span><span class='id first'>first</span><span class='period'>.</span><span class='id is_a?'>is_a?</span> <span class='const'>String</span>
|
1342
|
-
<span class='id
|
1343
|
-
<span class='id template'>template</span><span class='period'>.</span><span class='id concat'>concat</span><span class='lparen'>(</span><span class='id template'>template</span><span class='period'>.</span><span class='id content_tag'>content_tag</span><span class='lparen'>(</span><span class='symbol'>:div</span><span class='comma'>,</span> <span class='id header'>header</span><span class='comma'>,</span> <span class='symbol'>:class</span> <span class='op'>=></span> <span class='id html_header_class'>html_header_class</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
1559
|
+
<span class='id options'>options</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id args'>args</span><span class='period'>.</span><span class='id shift'>shift</span>
|
1344
1560
|
<span class='kw'>end</span>
|
1345
1561
|
|
1346
|
-
<span class='kw'>if</span> <span class='id
|
1347
|
-
<span class='id
|
1348
|
-
|
1349
|
-
<span class='
|
1350
|
-
|
1351
|
-
<span class='
|
1352
|
-
|
1353
|
-
<span class='
|
1354
|
-
|
1562
|
+
<span class='kw'>if</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='symbol'>:for</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id blank?'>blank?</span>
|
1563
|
+
<span class='id attributes_for'>attributes_for</span><span class='lparen'>(</span><span class='id record'>record</span><span class='comma'>,</span> <span class='id args'>args</span><span class='comma'>,</span> <span class='id options'>options</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span><span class='rparen'>)</span>
|
1564
|
+
<span class='kw'>else</span>
|
1565
|
+
<span class='kw'>if</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='symbol'>:for</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id is_a?'>is_a?</span> <span class='const'>Symbol</span>
|
1566
|
+
<span class='id for_value'>for_value</span> <span class='op'>=</span> <span class='id record'>record</span><span class='period'>.</span><span class='id send'>send</span><span class='lparen'>(</span><span class='id options'>options</span><span class='lbracket'>[</span><span class='symbol'>:for</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
1567
|
+
<span class='kw'>else</span>
|
1568
|
+
<span class='id for_value'>for_value</span> <span class='op'>=</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='symbol'>:for</span><span class='rbracket'>]</span>
|
1569
|
+
<span class='kw'>end</span>
|
1570
|
+
|
1571
|
+
<span class='lbracket'>[</span><span class='op'>*</span><span class='id for_value'>for_value</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id value'>value</span><span class='op'>|</span>
|
1572
|
+
<span class='id attributes_for'>attributes_for</span><span class='lparen'>(</span><span class='id value'>value</span><span class='comma'>,</span> <span class='id args'>args</span><span class='comma'>,</span> <span class='id options'>options</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span><span class='rparen'>)</span>
|
1573
|
+
<span class='kw'>end</span>
|
1355
1574
|
<span class='kw'>end</span>
|
1356
1575
|
|
1357
|
-
<span class='id template'>template</span><span class='period'>.</span><span class='id concat'>concat</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'></div></span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
1358
1576
|
<span class='kw'>end</span></pre>
|
1359
1577
|
</td>
|
1360
1578
|
</tr>
|
@@ -1366,7 +1584,7 @@ Name of html class(-es) to add to header
|
|
1366
1584
|
</div>
|
1367
1585
|
|
1368
1586
|
<div id="footer">
|
1369
|
-
Generated on
|
1587
|
+
Generated on Fri Jan 15 21:15:12 2010 by
|
1370
1588
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
1371
1589
|
0.5.3 (ruby-1.9.1).
|
1372
1590
|
</div>
|
@@ -245,18 +245,18 @@ Builder for attributes for given AR record
|
|
245
245
|
<pre class="lines">
|
246
246
|
|
247
247
|
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
248
|
+
382
|
249
|
+
383
|
250
|
+
384
|
251
|
+
385
|
252
|
+
386
|
253
|
+
387
|
254
|
+
388
|
255
|
+
389
|
256
|
+
390</pre>
|
257
257
|
</td>
|
258
258
|
<td>
|
259
|
-
<pre class="code"><span class="info file"># File 'lib/attrtastic.rb', line
|
259
|
+
<pre class="code"><span class="info file"># File 'lib/attrtastic.rb', line 382</span>
|
260
260
|
|
261
261
|
<span class='kw'>def</span> <span class='id semantic_attributes_for'>semantic_attributes_for</span><span class='lparen'>(</span><span class='id record'>record</span><span class='comma'>,</span> <span class='id options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span><span class='rparen'>)</span>
|
262
262
|
<span class='id options'>options</span><span class='lbracket'>[</span><span class='symbol'>:html</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
@@ -277,7 +277,7 @@ Builder for attributes for given AR record
|
|
277
277
|
</div>
|
278
278
|
|
279
279
|
<div id="footer">
|
280
|
-
Generated on
|
280
|
+
Generated on Fri Jan 15 21:15:12 2010 by
|
281
281
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
282
282
|
0.5.3 (ruby-1.9.1).
|
283
283
|
</div>
|
data/doc/Attrtastic.html
CHANGED
@@ -110,7 +110,7 @@ Boruta Mirosław
|
|
110
110
|
</div>
|
111
111
|
|
112
112
|
<div id="footer">
|
113
|
-
Generated on
|
113
|
+
Generated on Fri Jan 15 21:15:12 2010 by
|
114
114
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
115
115
|
0.5.3 (ruby-1.9.1).
|
116
116
|
</div>
|
data/doc/_index.html
CHANGED
data/doc/file.README.html
CHANGED
@@ -98,7 +98,7 @@ future version unintentionally.</li>
|
|
98
98
|
<p>Copyright (c) 2009 Boruta Miroslaw. See LICENSE for details.</p></div></div>
|
99
99
|
|
100
100
|
<div id="footer">
|
101
|
-
Generated on
|
101
|
+
Generated on Fri Jan 15 21:15:12 2010 by
|
102
102
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
103
103
|
0.5.3 (ruby-1.9.1).
|
104
104
|
</div>
|
data/doc/index.html
CHANGED
@@ -98,7 +98,7 @@ future version unintentionally.</li>
|
|
98
98
|
<p>Copyright (c) 2009 Boruta Miroslaw. See LICENSE for details.</p></div></div>
|
99
99
|
|
100
100
|
<div id="footer">
|
101
|
-
Generated on
|
101
|
+
Generated on Fri Jan 15 21:15:12 2010 by
|
102
102
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
103
103
|
0.5.3 (ruby-1.9.1).
|
104
104
|
</div>
|