Class: GrabzIt::Client
- Inherits:
-
Object
- Object
- GrabzIt::Client
- Defined in:
- lib/grabzit/client.rb
Overview
This client provides access to the GrabzIt web services This API allows you to take screenshot of websites for free and convert them into images, PDF’s and tables.
Instance Method Summary collapse
-
#add_watermark(identifier, path, xpos, ypos) ⇒ Boolean
Add a new custom watermark.
-
#create_encryption_key ⇒ String
This method creates a cryptographically secure encryption key to pass to the encryption key parameter.
-
#decrypt(data, key) ⇒ Array<Byte>
This method will decrypt a encrypted capture, using the key you passed to the encryption key parameter.
-
#decrypt_file(path, key) ⇒ Object
This method will decrypt a encrypted capture file, using the key you passed to the encryption key parameter.
-
#delete_cookie(name, domain) ⇒ Boolean
Delete a custom cookie or block a global cookie from being used.
-
#delete_watermark(identifier) ⇒ Boolean
Delete a custom watermark.
-
#file_to_docx(path, options = nil) ⇒ void
This method specifies a HTML file that should be converted into a DOCX.
-
#file_to_image(path, options = nil) ⇒ void
This method specifies a HTML file that should be converted into a image.
-
#file_to_pdf(path, options = nil) ⇒ void
This method specifies a HTML file that should be converted into a PDF.
-
#file_to_rendered_html(path, options = nil) ⇒ void
This method specifies a HTML file that should be converted into rendered HTML.
-
#file_to_table(path, options = nil) ⇒ void
This method specifies a HTML file that the HTML tables should be extracted from.
-
#file_to_video(path, options = nil) ⇒ void
This method specifies a HTML file that should be converted into a video.
-
#get_cookies(domain) ⇒ Array<Cookie>
Get all the cookies that GrabzIt is using for a particular domain.
-
#get_result(id) ⇒ Object
This method returns the screenshot itself.
-
#get_status(id) ⇒ ScreenShotStatus
Get the current status of a GrabzIt screenshot.
-
#get_watermark(identifier) ⇒ WaterMark
Get your uploaded custom watermark.
-
#get_watermarks ⇒ Array<WaterMark>
Get your uploaded custom watermarks.
-
#html_to_docx(html, options = nil) ⇒ void
This method specifies the HTML that should be converted into a DOCX.
-
#html_to_image(html, options = nil) ⇒ void
This method specifies the HTML that should be converted into a image.
-
#html_to_pdf(html, options = nil) ⇒ void
This method specifies the HTML that should be converted into a PDF.
-
#html_to_rendered_html(html, options = nil) ⇒ void
This method specifies the HTML that should be converted into rendered HTML.
-
#html_to_table(html, options = nil) ⇒ void
This method specifies the HTML that the HTML tables should be extracted from.
-
#html_to_video(html, options = nil) ⇒ void
This method specifies the HTML that should be converted into a video.
-
#initialize(applicationKey, applicationSecret) ⇒ Client
constructor
Create a new instance of the Client class in order to access the GrabzIt API.
-
#save(callBackURL = nil) ⇒ String
Calls the GrabzIt web service to take the screenshot.
-
#save_to(saveToFile = nil) ⇒ Boolean
Calls the GrabzIt web service to take the screenshot and saves it to the target path provided.
-
#set_cookie(name, domain, value = "", path = "/", httponly = false, expires = "") ⇒ Boolean
Sets a new custom cookie on GrabzIt, if the custom cookie has the same name and domain as a global cookie the global.
-
#set_local_proxy(value) ⇒ Object
This method enables a local proxy server to be used for all requests.
-
#url_to_animation(url, options = nil) ⇒ void
This method specifies the URL of the online video that should be converted into a animated GIF.
-
#url_to_docx(url, options = nil) ⇒ void
This method specifies the URL that should be converted into a DOCX.
-
#url_to_image(url, options = nil) ⇒ void
This method specifies the URL that should be converted into a image screenshot.
-
#url_to_pdf(url, options = nil) ⇒ void
This method specifies the URL that should be converted into a PDF.
-
#url_to_rendered_html(url, options = nil) ⇒ void
This method specifies the URL that should be converted into rendered HTML.
-
#url_to_table(url, options = nil) ⇒ void
This method specifies the URL that the HTML tables should be extracted from.
-
#url_to_video(url, options = nil) ⇒ void
This method specifies the URL that should be converted into a video.
-
#use_ssl(value) ⇒ Object
This method sets if requests to GrabzIt’s API should use SSL or not.
Constructor Details
#initialize(applicationKey, applicationSecret) ⇒ Client
Create a new instance of the Client class in order to access the GrabzIt API.
60 61 62 63 64 65 |
# File 'lib/grabzit/client.rb', line 60 def initialize(applicationKey, applicationSecret) @applicationKey = applicationKey @applicationSecret = applicationSecret @protocol = 'http' @proxy = Proxy.new() end |
Instance Method Details
#add_watermark(identifier, path, xpos, ypos) ⇒ Boolean
Add a new custom watermark
556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 |
# File 'lib/grabzit/client.rb', line 556 def add_watermark(identifier, path, xpos, ypos) if !File.file?(path) raise "File: " + path + " does not exist" end sig = encode(GrabzIt::Utility.nil_check(@applicationSecret)+"|"+GrabzIt::Utility.nil_check(identifier)+"|"+GrabzIt::Utility.nil_int_check(xpos)+ "|"+GrabzIt::Utility.nil_int_check(ypos)) boundary = '--------------------------'+Time.now.to_f.to_s url = @protocol + "://api.grabz.it/services/addwatermark" uri = URI.parse(url) file = File.open(path, "rb") data = file.read post_body = Array.new post_body << "\r\n--"+boundary+"\r\n" post_body << "Content-Disposition: form-data; name=\"watermark\"; filename=\""+File.basename(path)+"\"\r\nContent-Type: image/jpeg\r\n\r\n" post_body << data post_body << "\r\n--"+boundary+"\r\n" post_body << "Content-Disposition: form-data; name=\"key\"\r\n\r\n" post_body << GrabzIt::Utility.nil_check(@applicationKey) post_body << "\r\n--"+boundary+"\r\n" post_body << "Content-Disposition: form-data; name=\"identifier\"\r\n\r\n" post_body << GrabzIt::Utility.nil_check(identifier) post_body << "\r\n--"+boundary+"\r\n" post_body << "Content-Disposition: form-data; name=\"xpos\"\r\n\r\n" post_body << GrabzIt::Utility.nil_check(xpos) post_body << "\r\n--"+boundary+"\r\n" post_body << "Content-Disposition: form-data; name=\"ypos\"\r\n\r\n" post_body << GrabzIt::Utility.nil_check(ypos) post_body << "\r\n--"+boundary+"\r\n" post_body << "Content-Disposition: form-data; name=\"sig\"\r\n\r\n" post_body << sig post_body << "\r\n--"+boundary+"--\r\n" request = Net::HTTP::Post.new(url) request.content_type = "multipart/form-data, boundary="+boundary request.body = post_body.join caller = Net::HTTP.new(uri.host, uri.port) caller.use_ssl = uri.scheme == 'https' response = caller.start {|http| http.request(request)} response_check(response) return (get_result_value(response.body(), "Result") == TrueString) end |
#create_encryption_key ⇒ String
This method creates a cryptographically secure encryption key to pass to the encryption key parameter.
654 655 656 |
# File 'lib/grabzit/client.rb', line 654 def create_encryption_key() Base64.strict_encode64(OpenSSL::Random.random_bytes(32)); end |
#decrypt(data, key) ⇒ Array<Byte>
This method will decrypt a encrypted capture, using the key you passed to the encryption key parameter.
674 675 676 677 678 679 680 681 682 683 684 685 686 687 |
# File 'lib/grabzit/client.rb', line 674 def decrypt(data, key) if data == nil return nil end iv = data[0..15] payload = data[16..-1] cipher = OpenSSL::Cipher::Cipher.new("aes-256-cbc") cipher.padding = 0 cipher.key = Base64.strict_decode64(key); cipher.iv = iv decrypted = cipher.update(payload); decrypted << cipher.final(); return decrypted end |
#decrypt_file(path, key) ⇒ Object
This method will decrypt a encrypted capture file, using the key you passed to the encryption key parameter.
662 663 664 665 666 667 |
# File 'lib/grabzit/client.rb', line 662 def decrypt_file(path, key) data = read_file(path) decryptedFile = File.new(path, "wb") decryptedFile.write(decrypt(data, key)) decryptedFile.close end |
#delete_cookie(name, domain) ⇒ Boolean
Delete a custom cookie or block a global cookie from being used
512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 |
# File 'lib/grabzit/client.rb', line 512 def (name, domain) sig = encode(GrabzIt::Utility.nil_check(@applicationSecret)+"|"+GrabzIt::Utility.nil_check(name)+ "|"+GrabzIt::Utility.nil_check(domain)+"|1") qs = "key=" qs.concat(CGI.escape(GrabzIt::Utility.nil_check(@applicationKey))) qs.concat("&domain=") qs.concat(CGI.escape(GrabzIt::Utility.nil_check(domain))) qs.concat("&name=") qs.concat(CGI.escape(GrabzIt::Utility.nil_check(name))) qs.concat("&delete=1&sig=") qs.concat(sig) return (get_result_value(get(@protocol + WebServicesBaseURL + "setcookie?" + qs), "Result") == TrueString) end |
#delete_watermark(identifier) ⇒ Boolean
Delete a custom watermark
615 616 617 618 619 620 621 622 623 624 625 626 |
# File 'lib/grabzit/client.rb', line 615 def delete_watermark(identifier) sig = encode(GrabzIt::Utility.nil_check(@applicationSecret)+"|"+GrabzIt::Utility.nil_check(identifier)) qs = "key=" qs.concat(CGI.escape(GrabzIt::Utility.nil_check(@applicationKey))) qs.concat("&identifier=") qs.concat(CGI.escape(GrabzIt::Utility.nil_check(identifier))) qs.concat("&sig=") qs.concat(sig) return (get_result_value(get(@protocol + WebServicesBaseURL + "deletewatermark?" + qs), "Result") == TrueString) end |
#file_to_docx(path, options = nil) ⇒ void
This method returns an undefined value.
This method specifies a HTML file that should be converted into a DOCX
312 313 314 |
# File 'lib/grabzit/client.rb', line 312 def file_to_docx(path, = nil) html_to_docx(read_file(path), ) end |
#file_to_image(path, options = nil) ⇒ void
This method returns an undefined value.
This method specifies a HTML file that should be converted into a image
117 118 119 |
# File 'lib/grabzit/client.rb', line 117 def file_to_image(path, = nil) html_to_image(read_file(path), ) end |
#file_to_pdf(path, options = nil) ⇒ void
This method returns an undefined value.
This method specifies a HTML file that should be converted into a PDF
273 274 275 |
# File 'lib/grabzit/client.rb', line 273 def file_to_pdf(path, = nil) html_to_pdf(read_file(path), ) end |
#file_to_rendered_html(path, options = nil) ⇒ void
This method returns an undefined value.
This method specifies a HTML file that should be converted into rendered HTML
195 196 197 |
# File 'lib/grabzit/client.rb', line 195 def file_to_rendered_html(path, = nil) html_to_rendered_html(read_file(path), ) end |
#file_to_table(path, options = nil) ⇒ void
This method returns an undefined value.
This method specifies a HTML file that the HTML tables should be extracted from
234 235 236 |
# File 'lib/grabzit/client.rb', line 234 def file_to_table(path, = nil) html_to_table(read_file(path), ) end |
#file_to_video(path, options = nil) ⇒ void
This method returns an undefined value.
This method specifies a HTML file that should be converted into a video
156 157 158 |
# File 'lib/grabzit/client.rb', line 156 def file_to_video(path, = nil) html_to_video(read_file(path), ) end |
#get_cookies(domain) ⇒ Array<Cookie>
Get all the cookies that GrabzIt is using for a particular domain. This may include your user set cookies as well
438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 |
# File 'lib/grabzit/client.rb', line 438 def (domain) sig = encode(GrabzIt::Utility.nil_check(@applicationSecret)+"|"+GrabzIt::Utility.nil_check(domain)) qs = "key=" qs.concat(CGI.escape(GrabzIt::Utility.nil_check(@applicationKey))) qs.concat("&domain=") qs.concat(CGI.escape(GrabzIt::Utility.nil_check(domain))) qs.concat("&sig=") qs.concat(sig) result = get(@protocol + WebServicesBaseURL + "getcookies?" + qs) doc = REXML::Document.new(result) check_for_exception(doc) = Array.new = doc.elements.to_a("//WebResult/Cookies/Cookie") .each do || expires = nil if .elements["Expires"] != nil expires = .elements["Expires"].text end grabzItCookie = GrabzIt::Cookie.new(.elements["Name"].text, .elements["Domain"].text, .elements["Value"].text, .elements["Path"].text, (.elements["HttpOnly"].text == TrueString), expires, .elements["Type"].text) << grabzItCookie end return end |
#get_result(id) ⇒ Object
This method returns the screenshot itself. If nothing is returned then something has gone wrong or the screenshot is not ready yet
425 426 427 428 429 430 431 |
# File 'lib/grabzit/client.rb', line 425 def get_result(id) if id == nil || id == "" return nil end return get(@protocol + WebServicesBaseURL + "getfile?id=" + GrabzIt::Utility.nil_check(id)) end |
#get_status(id) ⇒ ScreenShotStatus
Get the current status of a GrabzIt screenshot
402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 |
# File 'lib/grabzit/client.rb', line 402 def get_status(id) if id == nil || id == "" return nil end result = get(@protocol + WebServicesBaseURL + "getstatus?id=" + GrabzIt::Utility.nil_check(id)) doc = REXML::Document.new(result) processing = doc.root.elements["Processing"].text() cached = doc.root.elements["Cached"].text() expired = doc.root.elements["Expired"].text() = doc.root.elements["Message"].text() return ScreenShotStatus.new((processing == TrueString), (cached == TrueString), (expired == TrueString), ) end |
#get_watermark(identifier) ⇒ WaterMark
Get your uploaded custom watermark
532 533 534 535 536 537 538 539 |
# File 'lib/grabzit/client.rb', line 532 def get_watermark(identifier) watermarks = find_watermarks(identifier) if watermarks.length == 1 return watermarks[0] end return nil end |
#get_watermarks ⇒ Array<WaterMark>
Get your uploaded custom watermarks
544 545 546 |
# File 'lib/grabzit/client.rb', line 544 def get_watermarks() return find_watermarks(nil) end |
#html_to_docx(html, options = nil) ⇒ void
This method returns an undefined value.
This method specifies the HTML that should be converted into a DOCX
297 298 299 300 301 302 303 304 305 |
# File 'lib/grabzit/client.rb', line 297 def html_to_docx(html, = nil) if == nil = DOCXOptions.new() end @request = Request.new(@protocol + WebServicesBaseURL + TakeDOCX, true, , html) return nil end |
#html_to_image(html, options = nil) ⇒ void
This method returns an undefined value.
This method specifies the HTML that should be converted into a image
102 103 104 105 106 107 108 109 110 |
# File 'lib/grabzit/client.rb', line 102 def html_to_image(html, = nil) if == nil = ImageOptions.new() end @request = Request.new(@protocol + WebServicesBaseURL + TakePicture, true, , html) return nil end |
#html_to_pdf(html, options = nil) ⇒ void
This method returns an undefined value.
This method specifies the HTML that should be converted into a PDF
258 259 260 261 262 263 264 265 266 |
# File 'lib/grabzit/client.rb', line 258 def html_to_pdf(html, = nil) if == nil = PDFOptions.new() end @request = Request.new(@protocol + WebServicesBaseURL + TakePDF, true, , html) return nil end |
#html_to_rendered_html(html, options = nil) ⇒ void
This method returns an undefined value.
This method specifies the HTML that should be converted into rendered HTML
180 181 182 183 184 185 186 187 188 |
# File 'lib/grabzit/client.rb', line 180 def html_to_rendered_html(html, = nil) if == nil = HTMLOptions.new() end @request = Request.new(@protocol + WebServicesBaseURL + TakeHTML, true, , html) return nil end |
#html_to_table(html, options = nil) ⇒ void
This method returns an undefined value.
This method specifies the HTML that the HTML tables should be extracted from
219 220 221 222 223 224 225 226 227 |
# File 'lib/grabzit/client.rb', line 219 def html_to_table(html, = nil) if == nil = TableOptions.new() end @request = Request.new(@protocol + WebServicesBaseURL + TakeTable, true, , html) return nil end |
#html_to_video(html, options = nil) ⇒ void
This method returns an undefined value.
This method specifies the HTML that should be converted into a video
141 142 143 144 145 146 147 148 149 |
# File 'lib/grabzit/client.rb', line 141 def html_to_video(html, = nil) if == nil = VideoOptions.new() end @request = Request.new(@protocol + WebServicesBaseURL + TakeVideo, true, , html) return nil end |
#save(callBackURL = nil) ⇒ String
This is the recommended method of saving a screenshot
Calls the GrabzIt web service to take the screenshot
The handler will be passed a URL with the following query string parameters:
-
message (is any error message associated with the screenshot)
-
customId (is a custom id you may have specified in the [AnimationOptions], [ImageOptions], [PDFOptions] or [TableOptions] classes)
-
id (is the unique id of the screenshot which can be used to retrieve the screenshot with the #get_result method)
-
filename (is the filename of the screenshot)
-
format (is the format of the screenshot)
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 |
# File 'lib/grabzit/client.rb', line 328 def save(callBackURL = nil) if @request == nil raise GrabzItException.new("No parameters have been set.", GrabzItException::PARAMETER_MISSING_PARAMETERS) end sig = encode(@request.()._getSignatureString(GrabzIt::Utility.nil_check(@applicationSecret), callBackURL, @request.getTargetUrl())) data = take(sig, callBackURL) if data == nil || data == "" data = take(sig, callBackURL) end if data == nil || data == "" raise GrabzItException.new("An unknown network error occurred, please try calling this method again.", GrabzItException::NETWORK_GENERAL_ERROR) end return get_result_value(data, "ID") end |
#save_to(saveToFile = nil) ⇒ Boolean
Warning, this is a SYNCHONOUS method and can take up to 5 minutes before a response
Calls the GrabzIt web service to take the screenshot and saves it to the target path provided. if no target path is provided it returns the screenshot byte data.
357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 |
# File 'lib/grabzit/client.rb', line 357 def save_to(saveToFile = nil) id = save() if id == nil || id == "" return false end #Wait for it to be possibly ready sleep((@request.().startDelay() / 1000) + 3) #Wait for it to be ready. while true do status = get_status(id) if !status.cached && !status.processing raise GrabzItException.new("The capture did not complete with the error: " + status., GrabzItException::RENDERING_ERROR) break elsif status.cached result = get_result(id) if !result raise GrabzItException.new("The capture could not be found on GrabzIt.", GrabzItException::RENDERING_MISSING_SCREENSHOT) break end if saveToFile == nil || saveToFile == "" return result end screenshot = File.new(saveToFile, "wb") screenshot.write(result) screenshot.close break end sleep(3) end return true end |
#set_cookie(name, domain, value = "", path = "/", httponly = false, expires = "") ⇒ Boolean
This can be useful if a websites functionality is controlled by cookies
Sets a new custom cookie on GrabzIt, if the custom cookie has the same name and domain as a global cookie the global
cookie is overridden
481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 |
# File 'lib/grabzit/client.rb', line 481 def (name, domain, value = "", path = "/", httponly = false, expires = "") sig = encode(GrabzIt::Utility.nil_check(@applicationSecret)+"|"+GrabzIt::Utility.nil_check(name)+"|"+GrabzIt::Utility.nil_check(domain)+ "|"+GrabzIt::Utility.nil_check(value)+"|"+GrabzIt::Utility.nil_check(path)+"|"+GrabzIt::Utility.b_to_str(httponly)+ "|"+GrabzIt::Utility.nil_check(expires)+"|0") qs = "key=" qs.concat(CGI.escape(GrabzIt::Utility.nil_check(@applicationKey))) qs.concat("&domain=") qs.concat(CGI.escape(GrabzIt::Utility.nil_check(domain))) qs.concat("&name=") qs.concat(CGI.escape(GrabzIt::Utility.nil_check(name))) qs.concat("&value=") qs.concat(CGI.escape(GrabzIt::Utility.nil_check(value))) qs.concat("&path=") qs.concat(CGI.escape(GrabzIt::Utility.nil_check(path))) qs.concat("&httponly=") qs.concat(GrabzIt::Utility.b_to_str(httponly)) qs.concat("&expires=") qs.concat(CGI.escape(GrabzIt::Utility.nil_check(expires))) qs.concat("&sig=") qs.concat(sig) return (get_result_value(get(@protocol + WebServicesBaseURL + "setcookie?" + qs), "Result") == TrueString) end |
#set_local_proxy(value) ⇒ Object
This method enables a local proxy server to be used for all requests
642 643 644 645 646 647 648 649 |
# File 'lib/grabzit/client.rb', line 642 def set_local_proxy(value) if value uri = URI.parse(value) @proxy = Proxy.new(uri.host, uri.port, uri.user, uri.password) else @proxy = Proxy.new() end end |
#url_to_animation(url, options = nil) ⇒ void
This method returns an undefined value.
This method specifies the URL of the online video that should be converted into a animated GIF
72 73 74 75 76 77 78 79 80 |
# File 'lib/grabzit/client.rb', line 72 def url_to_animation(url, = nil) if == nil = AnimationOptions.new() end @request = Request.new(@protocol + WebServicesBaseURL + "takeanimation", false, , url) return nil end |
#url_to_docx(url, options = nil) ⇒ void
This method returns an undefined value.
This method specifies the URL that should be converted into a DOCX
282 283 284 285 286 287 288 289 290 |
# File 'lib/grabzit/client.rb', line 282 def url_to_docx(url, = nil) if == nil = DOCXOptions.new() end @request = Request.new(@protocol + WebServicesBaseURL + TakeDOCX, false, , url) return nil end |
#url_to_image(url, options = nil) ⇒ void
This method returns an undefined value.
This method specifies the URL that should be converted into a image screenshot
87 88 89 90 91 92 93 94 95 |
# File 'lib/grabzit/client.rb', line 87 def url_to_image(url, = nil) if == nil = ImageOptions.new() end @request = Request.new(@protocol + WebServicesBaseURL + TakePicture, false, , url) return nil end |
#url_to_pdf(url, options = nil) ⇒ void
This method returns an undefined value.
This method specifies the URL that should be converted into a PDF
243 244 245 246 247 248 249 250 251 |
# File 'lib/grabzit/client.rb', line 243 def url_to_pdf(url, = nil) if == nil = PDFOptions.new() end @request = Request.new(@protocol + WebServicesBaseURL + TakePDF, false, , url) return nil end |
#url_to_rendered_html(url, options = nil) ⇒ void
This method returns an undefined value.
This method specifies the URL that should be converted into rendered HTML
165 166 167 168 169 170 171 172 173 |
# File 'lib/grabzit/client.rb', line 165 def url_to_rendered_html(url, = nil) if == nil = HTMLOptions.new() end @request = Request.new(@protocol + WebServicesBaseURL + TakeHTML, false, , url) return nil end |
#url_to_table(url, options = nil) ⇒ void
This method returns an undefined value.
This method specifies the URL that the HTML tables should be extracted from
204 205 206 207 208 209 210 211 212 |
# File 'lib/grabzit/client.rb', line 204 def url_to_table(url, = nil) if == nil = TableOptions.new() end @request = Request.new(@protocol + WebServicesBaseURL + TakeTable, false, , url) return nil end |
#url_to_video(url, options = nil) ⇒ void
This method returns an undefined value.
This method specifies the URL that should be converted into a video
126 127 128 129 130 131 132 133 134 |
# File 'lib/grabzit/client.rb', line 126 def url_to_video(url, = nil) if == nil = VideoOptions.new() end @request = Request.new(@protocol + WebServicesBaseURL + TakeVideo, false, , url) return nil end |
#use_ssl(value) ⇒ Object
This method sets if requests to GrabzIt’s API should use SSL or not
631 632 633 634 635 636 637 |
# File 'lib/grabzit/client.rb', line 631 def use_ssl(value) if value @protocol = 'https' else @protocol = 'http' end end |