Method: Act::Helper.prettify
- Defined in:
- lib/act/helper.rb
.prettify(string, lexer) ⇒ Object
75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/act/helper.rb', line 75 def self.prettify(string, lexer) raise ArgumentError unless string raise ArgumentError unless lexer case lexer when 'json' require 'json' JSON.pretty_generate(JSON.parse(string)) else string end end |