Class: SOAP::SOAPDate

Inherits:
Object
  • Object
show all
Defined in:
lib/adwords4r/soap4rpatches.rb

Overview

Fix an issue with SOAPDate. Google complains if the dates have any timezone info in them. There are probably better ways to fix this.

Instance Method Summary collapse

Instance Method Details

#of2tz(offset) ⇒ Object



38
39
40
41
42
43
44
45
46
# File 'lib/adwords4r/soap4rpatches.rb', line 38

def of2tz(offset)
  diffmin = offset * 24 * 60
  if diffmin.zero?
    ''
  else
    ((diffmin < 0) ? '-' : '+') << format('%02d:%02d',
      (diffmin.abs / 60.0).to_i, (diffmin.abs % 60.0).to_i)
  end
end