Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/fwtoolkit.rb

Overview

add as_json to Array

Instance Method Summary collapse

Instance Method Details

#to_jsonObject



12
13
14
15
16
17
18
19
# File 'lib/fwtoolkit.rb', line 12

def to_json(*)
  contents = ""
  self.each_index do |i|
    contents << self[i].to_json
    contents << ',' unless i == self.length - 1 
  end
  "[#{contents}]"
end