quickbase_client 1.0.11 → 1.0.12
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/README.rdoc +2 -0
- data/lib/QuickBaseClient.rb +9 -3
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -29,6 +29,8 @@ More information about the QuickBase Client is available here -
|
|
29
29
|
|
30
30
|
== Change History
|
31
31
|
|
32
|
+
1.0.12 - 05/08/2011 - Added findRecords and find_records getFilteredRecords aliases.
|
33
|
+
|
32
34
|
1.0.11 - 05/08/2011 - Fixed a problem with getFilteredRecords().
|
33
35
|
|
34
36
|
1.0.10 - 03/27/2011 - Can now use require 'quickbase_client' instead of require 'QuickBaseClient'.
|
data/lib/QuickBaseClient.rb
CHANGED
@@ -3410,7 +3410,7 @@ class Client
|
|
3410
3410
|
end
|
3411
3411
|
|
3412
3412
|
# Same as iterateRecords but with fields optionally filtered by Ruby regular expressions.
|
3413
|
-
# e.g. iterateFilteredRecords( "dhnju5y7", [{"Name" => "[A-E].+}
|
3413
|
+
# e.g. iterateFilteredRecords( "dhnju5y7", [{"Name" => "[A-E].+"},"Address"] ) { |values| puts values["Name"], values["Address"] }
|
3414
3414
|
def iterateFilteredRecords( dbid, fieldNames, query = nil, qid = nil, qname = nil, clist = nil, slist = nil, fmt = "structured", options = nil )
|
3415
3415
|
fields = []
|
3416
3416
|
regexp = {}
|
@@ -3428,7 +3428,10 @@ class Client
|
|
3428
3428
|
match = true
|
3429
3429
|
fields.each{|field|
|
3430
3430
|
if regexp[field]
|
3431
|
-
|
3431
|
+
unless record[field] and record[field].match(regexp[field])
|
3432
|
+
match = false
|
3433
|
+
break
|
3434
|
+
end
|
3432
3435
|
end
|
3433
3436
|
}
|
3434
3437
|
yield record if match
|
@@ -3438,7 +3441,7 @@ class Client
|
|
3438
3441
|
}
|
3439
3442
|
end
|
3440
3443
|
|
3441
|
-
# e.g. getFilteredRecords( "dhnju5y7", [{"Name" => "[A-E].+}
|
3444
|
+
# e.g. getFilteredRecords( "dhnju5y7", [{"Name" => "[A-E].+"},"Address"] ) { |values| puts values["Name"], values["Address"] }
|
3442
3445
|
def getFilteredRecords( dbid, fieldNames, query = nil, qid = nil, qname = nil, clist = nil, slist = nil, fmt = "structured", options = nil )
|
3443
3446
|
filteredRecords = []
|
3444
3447
|
iterateFilteredRecords(dbid, fieldNames, query, qid, qname, clist, slist, fmt, options){ |filteredRecord|
|
@@ -3446,6 +3449,9 @@ class Client
|
|
3446
3449
|
}
|
3447
3450
|
filteredRecords
|
3448
3451
|
end
|
3452
|
+
|
3453
|
+
alias findRecords getFilteredRecords
|
3454
|
+
alias find_records getFilteredRecords
|
3449
3455
|
|
3450
3456
|
# Get records from two or more tables and/or queries with the same value in a
|
3451
3457
|
# 'join' field and loop through the joined results.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quickbase_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.12
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-05-
|
12
|
+
date: 2011-05-09 00:00:00.000000000Z
|
13
13
|
dependencies: []
|
14
14
|
description: Wraps the QuickBase HTTP API and adds classes and methods to minimize
|
15
15
|
the amount of code need to get useful things done. This is a minimal subset of the
|