Module: Pizzazz

Defined in:
lib/pizzazz.rb,
lib/pizzazz/html.rb,
lib/pizzazz/engine.rb,
lib/pizzazz/colorer.rb,
lib/pizzazz/version.rb

Defined Under Namespace

Classes: Colorer, Engine

Constant Summary collapse

RAILS_AVAILABLE =
begin
  require 'rails'
  require 'pizzazz/engine'
  true
rescue LoadError
  false
end
VERSION =
'0.2.0'

Class Method Summary collapse

Class Method Details

.ify(object, options = nil) ⇒ Object



10
11
12
13
# File 'lib/pizzazz.rb', line 10

def self.ify(object, options = nil)
  p = Colorer.new(object, options)
  p.ify
end

.ify_html(object, options = nil) ⇒ Object



2
3
4
5
6
7
# File 'lib/pizzazz/html.rb', line 2

def self.ify_html(object, options = nil)
  p = Colorer.new(object, options)
  html = %Q{<pre class="pizzazz">#{p.ify}</pre>}
  html = html.html_safe if Pizzazz::RAILS_AVAILABLE
  html
end