cw_sort_order 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/cw_sort_order.rb +11 -0
- data/test/test_sort_order.rb +5 -0
- metadata +3 -3
data/lib/cw_sort_order.rb
CHANGED
@@ -344,5 +344,16 @@ class SortOrder
|
|
344
344
|
@ordering.concat(o.ordering)
|
345
345
|
self
|
346
346
|
end
|
347
|
+
|
348
|
+
# To String
|
349
|
+
#
|
350
|
+
# Converts a Sort Order to a SQL string
|
351
|
+
#
|
352
|
+
# Returns:
|
353
|
+
# (String) version of the order as you would specify to a SQL query
|
354
|
+
def to_s
|
355
|
+
self.collect{|col,dir| "'#{col}' #{dir}"}.join(',')
|
356
|
+
end
|
357
|
+
|
347
358
|
end # SortOrder
|
348
359
|
end # CW
|
data/test/test_sort_order.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cw_sort_order
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 3
|
10
|
+
version: 1.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Christopher Wojno
|