Class: SiSU_JSONutils::Clean
- Inherits:
-
Object
- Object
- SiSU_JSONutils::Clean
- Defined in:
- lib/sisu/json_shared.rb
Instance Method Summary collapse
-
#initialize(para = '') ⇒ Clean
constructor
A new instance of Clean.
-
#line_json_clean ⇒ Object
@para,@n_char_max,@n_indent,@post,=para,n_char_max,n_indent,post @n_hang=n_hang ? n_hang : @n_indent.
Constructor Details
#initialize(para = '') ⇒ Clean
Returns a new instance of Clean.
58 59 60 61 62 63 |
# File 'lib/sisu/json_shared.rb', line 58 def initialize(para='') @para=para #@para,@n_char_max,@n_indent,@post,=para,n_char_max,n_indent,post #@n_char_max_extend = n_char_max #@n_hang=n_hang ? n_hang : @n_indent end |
Instance Method Details
#line_json_clean ⇒ Object
@para,@n_char_max,@n_indent,@post,=para,n_char_max,n_indent,post @n_hang=n_hang ? n_hang : @n_indent
64 65 66 67 68 69 70 |
# File 'lib/sisu/json_shared.rb', line 64 def line_json_clean @para=@para.gsub(/<br>/,' \\ '). gsub(/#{Mx[:br_nl]}/,"\n\n"). gsub(/"/,'\"'). gsub(/'/,"\\\\'") @para end |