Module: GoogleSpreadsheet::Util

Included in:
Session, Session, Spreadsheet, Table, Worksheet
Defined in:
lib/google_spreadsheet.rb

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.as_utf8(str) ⇒ Object



101
102
103
104
105
106
107
# File 'lib/google_spreadsheet.rb', line 101

def as_utf8(str)
  if str.respond_to?(:force_encoding)
    str.force_encoding("UTF-8")
  else
    str
  end
end

.encode_query(params) ⇒ Object



93
94
95
# File 'lib/google_spreadsheet.rb', line 93

def encode_query(params)
  return params.map(){ |k, v| CGI.escape(k) + "=" + CGI.escape(v) }.join("&")
end

.h(str) ⇒ Object



97
98
99
# File 'lib/google_spreadsheet.rb', line 97

def h(str)
  return CGI.escapeHTML(str.to_s())
end