class Rembrandt::Engines::WebService
Public Class Methods
available?()
click to toggle source
# File lib/rembrandt/engines/web_service.rb, line 15 def self.available? site = Net::HTTP.new('pygmentize.herokuapp.com', 80) site.request_head('/').code == "200" end
Public Instance Methods
highlight(input, language)
click to toggle source
# File lib/rembrandt/engines/web_service.rb, line 7 def highlight(input, language) Net::HTTP.post_form(url, {'lang'=>language, 'code'=>input}).body end
url()
click to toggle source
# File lib/rembrandt/engines/web_service.rb, line 11 def url @url ||= URI.parse('http://pygmentize.herokuapp.com/') end