Class: Hylite::CodeRay
Instance Attribute Summary
Attributes inherited from Hyliter
#code, #lang
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Hyliter
#initialize, new?
Class Method Details
.available? ⇒ Boolean
75
76
77
78
79
80
|
# File 'lib/hylite/hyliters.rb', line 75
def self.available?
require 'coderay'
true
rescue LoadError
false
end
|
Instance Method Details
#call ⇒ Object
86
87
88
|
# File 'lib/hylite/hyliters.rb', line 86
def call
::CodeRay.encode(code, lang, :terminal)
end
|
#type ⇒ Object
82
83
84
|
# File 'lib/hylite/hyliters.rb', line 82
def type
:coderay
end
|