Class: Pekky::Format::Formatters
Overview
The formatter wrapper. Adds a few additional methods for defaults etc.
Class Method Summary collapse
-
.defaults ⇒ Object
Returns the default text formatter – textile.
-
.format(name, text, opts = {}) ⇒ Object
Call the renderer by name rather than having the code drop down to method missing.
-
.text(text, opts = {}) ⇒ Object
This is the default formatter.
Methods inherited from Wrapper
[], add, each, keys, method_missing, values
Class Method Details
.defaults ⇒ Object
Returns the default text formatter – textile
72 73 74 |
# File 'lib/pekky/format.rb', line 72 def self.defaults Config[:text_formatter] end |
.format(name, text, opts = {}) ⇒ Object
Call the renderer by name rather than having the code drop down to method missing. This will mainly be used internally in Pekky.
84 85 86 |
# File 'lib/pekky/format.rb', line 84 def self.format(name, text, opts = {}) self.klasses[name]._format(text, opts) end |
.text(text, opts = {}) ⇒ Object
This is the default formatter. It’ll use the setting set in the site config, or the built in default – textile.
78 79 80 |
# File 'lib/pekky/format.rb', line 78 def self.text(text, opts = {}) self.klasses[defaults]._format(text, opts) end |