Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/fwtoolkit.rb
Overview
add as_json to Array
Instance Method Summary collapse
Instance Method Details
#to_json ⇒ Object
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 |