Module: JSer
Overview
Since ngi is an AngularJS tool and the users are familiar with JavaScript, this module of classes prints a string version of a Ruby hash or array as it would appear in normal JavaScript syntax For example: { “hello” => “world” } becomes: { ‘hello’: ‘world’ } and [“some”,“array”] becomes:
- ‘some’,‘array’
Defined Under Namespace
Instance Method Summary collapse
Instance Method Details
#to_str ⇒ Object
18 19 20 |
# File 'lib/ngi/utils/jser.rb', line 18 def to_str to_s.gsub(/\"/, "'").gsub(/\=\>/, ': ') end |