Module: ProsperWorks::SerializeEntity
- Included in:
- Base
- Defined in:
- lib/prosperworks/utils.rb
Overview
Modified version of the Jsonable gem, all credit goes to the authors of that gem
Instance Method Summary collapse
Instance Method Details
#to_json(*a) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/prosperworks/utils.rb', line 11 def to_json(*a) result = {} self.instance_variables.each do |var| trimmed_var = var.to_s.gsub!("@", "") result[trimmed_var] = self.instance_variable_get var end result.to_json(*a) end |