Module: JekyllEvalFilter
- Defined in:
- lib/evaluate.rb,
lib/jekyll_eval_filter/version.rb
Overview
Sample Jekyll filter.
Constant Summary collapse
- VERSION =
'0.1.3'.freeze
Class Attribute Summary collapse
-
.logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
-
#evaluate(input_string) ⇒ String
This Jekyll filter evaluates the input string and returns the result.
Class Attribute Details
.logger ⇒ Object
Returns the value of attribute logger.
6 7 8 |
# File 'lib/evaluate.rb', line 6 def logger @logger end |
Instance Method Details
#evaluate(input_string) ⇒ String
This Jekyll filter evaluates the input string and returns the result. Use it as a calculator or one-line Ruby program evaluator.
17 18 19 20 21 |
# File 'lib/evaluate.rb', line 17 def evaluate(input_string) input_string.strip! JekyllEvalFilter.logger.debug { "input_string=#{input_string}" } Kernel.eval input_string.strip end |