Module: JSer

Included in:
JSArray, JSHash
Defined in:
lib/ngi/utils/jser.rb

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

Classes: JSArray, JSHash

Instance Method Summary collapse

Instance Method Details

#to_strObject



18
19
20
# File 'lib/ngi/utils/jser.rb', line 18

def to_str
  to_s.gsub(/\"/, "'").gsub(/\=\>/, ': ')
end