Class: GoogleLoader::API

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-googleloader.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAPI

Returns a new instance of API.



14
15
16
# File 'lib/ruby-googleloader.rb', line 14

def initialize()
  @conf ||= []
end

Instance Attribute Details

#developer_keyObject

Returns the value of attribute developer_key.



12
13
14
# File 'lib/ruby-googleloader.rb', line 12

def developer_key
  @developer_key
end

Instance Method Details

#chrome_frame(version = 1, uncompressed = nil) ⇒ Object



18
19
20
21
22
23
24
25
26
27
# File 'lib/ruby-googleloader.rb', line 18

def chrome_frame(version = 1, uncompressed = nil)
  if uncompressed
    uncompressed = ", {uncompressed:true}"
  end
  @conf.push(
<<EOF
  google.load("chrome-frame", "#{version}"#{uncompressed});
EOF
).uniq!
end

#dojo(version = 1, uncompressed = nil) ⇒ Object



29
30
31
32
33
34
35
36
37
38
# File 'lib/ruby-googleloader.rb', line 29

def dojo(version = 1, uncompressed = nil)
  if uncompressed
    uncompressed = ", {uncompressed:true}"
  end
  @conf.push(
<<EOF
  google.load("dojo", "#{version}"#{uncompressed});
EOF
).uniq!
end

#earth(version = "*") ⇒ Object



204
205
206
207
208
209
210
# File 'lib/ruby-googleloader.rb', line 204

def earth(version = "*")
  @conf.push(
<<EOF
  google.load("earth", "#{version}"#{optstring});
EOF
).uniq!
end

#ext_core(version = 1, uncompressed = nil) ⇒ Object



40
41
42
43
44
45
46
47
48
49
# File 'lib/ruby-googleloader.rb', line 40

def ext_core(version = 1, uncompressed = nil)
  if uncompressed
    uncompressed = ", {uncompressed:true}"
  end
  @conf.push(
<<EOF
  google.load("ext-core", "#{version}"#{uncompressed});
EOF
).uniq!
end

#feeds(version = "*", options = nil) ⇒ Object



165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/ruby-googleloader.rb', line 165

def feeds(version = "*", options = nil)
  if options
   optstring = ", {#{options}}"
  else
   optstring = ""
  end
  @conf.push(
<<EOF
  google.load("feeds", "#{version}"#{optstring});
EOF
).uniq!
end

#friendconnect(version = "*", options = nil) ⇒ Object



225
226
227
228
229
230
231
232
233
234
235
236
# File 'lib/ruby-googleloader.rb', line 225

def friendconnect(version = "*", options = nil)
  if options
   optstring = ", {#{options}}"
  else
   optstring = ""
  end
  @conf.push(
<<EOF
  google.load("friendconnect", "#{version}"#{optstring});
EOF
).uniq!
end

#gdata(version = "*", options = nil) ⇒ Object



191
192
193
194
195
196
197
198
199
200
201
202
# File 'lib/ruby-googleloader.rb', line 191

def gdata(version = "*", options = nil)
  if options
   optstring = ", {#{options}}"
  else
   optstring = ""
  end
  @conf.push(
<<EOF
  google.load("maps", "#{version}"#{optstring});
EOF
).uniq!
end

#jquery(version = 1, uncompressed = nil) ⇒ Object



51
52
53
54
55
56
57
58
59
60
# File 'lib/ruby-googleloader.rb', line 51

def jquery(version = 1, uncompressed = nil)
  if uncompressed
    uncompressed = ", {uncompressed:true}"
  end
  @conf.push(
<<EOF
  google.load("jquery", "#{version}"#{uncompressed});
EOF
).uniq!
end

#jqueryui(version = 1, uncompressed = nil) ⇒ Object



62
63
64
65
66
67
68
69
70
71
# File 'lib/ruby-googleloader.rb', line 62

def jqueryui(version = 1, uncompressed = nil)
  if uncompressed
    uncompressed = ", {uncompressed:true}"
  end
  @conf.push(
<<EOF
  google.load("dojo", "#{version}"#{uncompressed});
EOF
).uniq!
end

#language(version = "*", options = nil) ⇒ Object



178
179
180
181
182
183
184
185
186
187
188
189
# File 'lib/ruby-googleloader.rb', line 178

def language(version = "*", options = nil)
  if options
   optstring = ", {#{options}}"
  else
   optstring = ""
  end
  @conf.push(
<<EOF
  google.load("language", "#{version}"#{optstring});
EOF
).uniq!
end

#maps(version = "*", options = nil) ⇒ Object



139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/ruby-googleloader.rb', line 139

def maps(version = "*", options = nil)
  if options
   optstring = ", {#{options}}"
  else
   optstring = ""
  end
  @conf.push(
<<EOF
  google.load("maps", "#{version}"#{optstring});
EOF
).uniq!
end

#markupObject



251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
# File 'lib/ruby-googleloader.rb', line 251

def markup
  if @developer_key
    config = Array.new
    config.push(
<<EOF
<script type="text/javascript" src="https://www.google.com/jsapi?key=#{@developer_key}"></script>
<script type="text/javascript">
#{@conf}
</script>
EOF
)
    return config
  else
    raise "No Developer Key!"
    return false
  end
end

#mootools(version = 1, uncompressed = nil) ⇒ Object



73
74
75
76
77
78
79
80
81
82
# File 'lib/ruby-googleloader.rb', line 73

def mootools(version = 1, uncompressed = nil)
  if uncompressed
    uncompressed = ", {uncompressed:true}"
  end
  @conf.push(
<<EOF
  google.load("mootools", "#{version}"#{uncompressed});
EOF
).uniq!
end

#orkut(version = "*", options = nil) ⇒ Object



238
239
240
241
242
243
244
245
246
247
248
249
# File 'lib/ruby-googleloader.rb', line 238

def orkut(version = "*", options = nil)
  if options
   optstring = ", {#{options}}"
  else
   optstring = ""
  end
  @conf.push(
<<EOF
  google.load("orkut", "#{version}"#{optstring});
EOF
).uniq!
end

#prototype(version = 1, uncompressed = nil) ⇒ Object



84
85
86
87
88
89
90
91
92
93
# File 'lib/ruby-googleloader.rb', line 84

def prototype(version = 1, uncompressed = nil)
  if uncompressed
    uncompressed = ", {uncompressed:true}"
  end
  @conf.push(
<<EOF
  google.load("prototype", "#{version}"#{uncompressed});
EOF
).uniq!
end

#scriptaculous(version = 1, uncompressed = nil) ⇒ Object



95
96
97
98
99
100
101
102
103
104
# File 'lib/ruby-googleloader.rb', line 95

def scriptaculous(version = 1, uncompressed = nil)
  if uncompressed
    uncompressed = ", {uncompressed:true}"
  end
  @conf.push(
<<EOF
  google.load("scriptaculous", "#{version}"#{uncompressed});
EOF
).uniq!
end

#search(version = "*", options = nil) ⇒ Object



152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/ruby-googleloader.rb', line 152

def search(version = "*", options = nil)
  if options
   optstring = ", {#{options}}"
  else
   optstring = ""
  end
  @conf.push(
<<EOF
  google.load("search", "#{version}"#{optstring});
EOF
).uniq!
end

#swfobject(version = 1, uncompressed = nil) ⇒ Object



106
107
108
109
110
111
112
113
114
115
# File 'lib/ruby-googleloader.rb', line 106

def swfobject(version = 1, uncompressed = nil)
  if uncompressed
    uncompressed = ", {uncompressed:true}"
  end
  @conf.push(
<<EOF
  google.load("swfobject", "#{version}"#{uncompressed});
EOF
).uniq!
end

#visualization(version = "*", options = nil) ⇒ Object



212
213
214
215
216
217
218
219
220
221
222
223
# File 'lib/ruby-googleloader.rb', line 212

def visualization(version = "*", options = nil)
  if options
   optstring = ", {#{options}}"
  else
   optstring = ""
  end
  @conf.push(
<<EOF
  google.load("visualization", "#{version}"#{optstring});
EOF
).uniq!
end

#webfont(version = 1, uncompressed = nil) ⇒ Object



128
129
130
131
132
133
134
135
136
137
# File 'lib/ruby-googleloader.rb', line 128

def webfont(version = 1, uncompressed = nil)
  if uncompressed
    uncompressed = ", {uncompressed:true}"
  end
  @conf.push(
<<EOF
  google.load("webfont", "#{version}"#{uncompressed});
EOF
).uniq!
end

#yui(version = 1, uncompressed = nil) ⇒ Object



117
118
119
120
121
122
123
124
125
126
# File 'lib/ruby-googleloader.rb', line 117

def yui(version = 1, uncompressed = nil)
  if uncompressed
    uncompressed = ", {uncompressed:true}"
  end
  @conf.push(
<<EOF
  google.load("yui", "#{version}"#{uncompressed});
EOF
).uniq!
end