quickbase_client 1.0.12 → 1.0.13

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.
Files changed (3) hide show
  1. data/README.rdoc +2 -0
  2. data/lib/QuickBaseClient.rb +21 -2
  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.13 - 05/10/2011 - Added getRecords(): get an array of records using record ids.
33
+
32
34
  1.0.12 - 05/08/2011 - Added findRecords and find_records getFilteredRecords aliases.
33
35
 
34
36
  1.0.11 - 05/08/2011 - Fixed a problem with getFilteredRecords().
@@ -3026,9 +3026,10 @@ class Client
3026
3026
 
3027
3027
  # Get a record as a Hash, using the record id and dbid .
3028
3028
  # e.g. getRecord("24105","8emtadvk"){|myRecord| p myRecord}
3029
- def getRecord(rid, dbid = @dbid)
3029
+ def getRecord(rid, dbid = @dbid, fieldNames = nil)
3030
3030
  rec = nil
3031
- iterateRecords(dbid, getFieldNames(dbid),"{'3'.EX.'#{rid}'}"){|r| rec = r }
3031
+ fieldNames ||= getFieldNames(dbid)
3032
+ iterateRecords(dbid, fieldNames,"{'3'.EX.'#{rid}'}"){|r| rec = r }
3032
3033
  if block_given?
3033
3034
  yield rec
3034
3035
  else
@@ -3036,6 +3037,24 @@ class Client
3036
3037
  end
3037
3038
  end
3038
3039
 
3040
+ # Get an array of records as Hashes, using the record ids and dbid .
3041
+ # e.g. getRecords(["24105","24107"],"8emtadvk"){|myRecord| p myRecord}
3042
+ def getRecords(rids, dbid = @dbid, fieldNames = nil)
3043
+ records = []
3044
+ if rids.length > 0
3045
+ query = ""
3046
+ rids.each{|rid| query << "{'3'.EX.'#{rid}'}OR"}
3047
+ query[-2] = ""
3048
+ fieldNames ||= getFieldNames(dbid)
3049
+ iterateRecords(dbid,fieldNames,query){|r| records << r }
3050
+ end
3051
+ if block_given?
3052
+ records.each{|rec|yield rec}
3053
+ else
3054
+ records
3055
+ end
3056
+ end
3057
+
3039
3058
  # Loop through the list of Pages for an application
3040
3059
  def iterateDBPages(dbid)
3041
3060
  listDBPages(dbid){|page|
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.12
4
+ version: 1.0.13
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-09 00:00:00.000000000Z
12
+ date: 2011-05-10 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