quickbase_client 1.0.5 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.rdoc +2 -0
  2. data/lib/QuickBaseClient.rb +7 -26
  3. metadata +3 -3
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.7 - 03/06/2011 - Fixed a problem with formatTimeOfDay().
33
+
32
34
  1.0.5 - 02/22/2011 - Updated API_GetUserRole for optional inclgrps parameter.
33
35
 
34
36
  1.0.4 - 12/24/2010 - Fixed formatDate() error.
@@ -805,12 +805,13 @@ class Client
805
805
  end
806
806
 
807
807
  # Get an array of field IDs for a table.
808
- def getFieldIDs(dbid = nil)
808
+ def getFieldIDs(dbid = nil, exclude_built_in_fields = false )
809
809
  fieldIDs = []
810
810
  dbid ||= @dbid
811
811
  getSchema(dbid)
812
812
  if @fields
813
813
  @fields.each_element_with_attribute( "id" ){|f|
814
+ next if exclude_built_in_fields and isBuiltInField?(f.attributes["id"])
814
815
  fieldIDs << f.attributes[ "id" ].dup
815
816
  }
816
817
  end
@@ -818,12 +819,13 @@ class Client
818
819
  end
819
820
 
820
821
  # Get an array of field names for a table.
821
- def getFieldNames( dbid = nil, lowerOrUppercase = "" )
822
+ def getFieldNames( dbid = nil, lowerOrUppercase = "", exclude_built_in_fields = false )
822
823
  fieldNames = []
823
824
  dbid ||= @dbid
824
825
  getSchema(dbid)
825
826
  if @fields
826
827
  @fields.each_element_with_attribute( "id" ){ |f|
828
+ next if exclude_built_in_fields and isBuiltInField?(f.attributes["id"])
827
829
  if f.name == "field"
828
830
  if lowerOrUppercase == "lowercase"
829
831
  fieldNames << f.elements[ "label" ].text.downcase
@@ -1376,29 +1378,8 @@ class Client
1376
1378
  # Returns a string format for a time of day value.
1377
1379
  def formatTimeOfDay(milliseconds, format = "%I:%M %p" )
1378
1380
  format ||= "%I:%M %p"
1379
- timeOfDay = format.dup
1380
- milliseconds ||= 0
1381
- if milliseconds.to_i == 0
1382
- timeOfDay = ""
1383
- else
1384
- seconds = (milliseconds.to_i/1000)
1385
- minutes = (seconds/60)
1386
- hoursLeft = (minutes/60)
1387
- minutesLeft = minutes - (hoursLeft*60)
1388
- secondsLeft = seconds - ((hoursLeft*60*60) + (minutesLeft*60))
1389
- timeOfDay.gsub!("%H",hoursLeft.to_s)
1390
- timeOfDay.gsub!("%I",(hoursLeft-12).to_s)
1391
- timeOfDay.gsub!("%M",minutesLeft.to_s)
1392
- timeOfDay.gsub!("%S",secondsLeft.to_s)
1393
- if format.include?("%p")
1394
- if hoursLeft > 12
1395
- timeOfDay.gsub!("%p","pm")
1396
- else
1397
- timeOfDay.gsub!("%p","am")
1398
- end
1399
- end
1400
- end
1401
- timeOfDay
1381
+ timeOfDay = ""
1382
+ timeOfDay = Time.at(milliseconds.to_i/1000).utc.strftime(format) if milliseconds
1402
1383
  end
1403
1384
 
1404
1385
  # Returns a string formatted for a currency value.
@@ -2698,7 +2679,7 @@ class Client
2698
2679
  end
2699
2680
 
2700
2681
  # API_GetUserRole, using the active table id.
2701
- def _getUserRole( userid ) getUserRole( @dbid, userid ) end
2682
+ def _getUserRole( userid, inclgrps = nil ) getUserRole( @dbid, userid, inclgrps ) end
2702
2683
 
2703
2684
  # API_GrantedDBs
2704
2685
  def grantedDBs( withembeddedtables = nil, excludeparents = nil, adminOnly = nil, includeancestors = nil, showAppData = nil )
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.5
4
+ version: 1.0.7
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-02-19 00:00:00.000000000 -08:00
12
+ date: 2011-03-06 00:00:00.000000000 -08:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
  description: Wraps the QuickBase HTTP API and adds classes and methods to minimize
@@ -58,7 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
58
58
  version: '0'
59
59
  requirements: []
60
60
  rubyforge_project: orphans
61
- rubygems_version: 1.5.2
61
+ rubygems_version: 1.6.1
62
62
  signing_key:
63
63
  specification_version: 3
64
64
  summary: Ruby wrapper for the QuickBase HTTP API. This is a minimal subset of the