Method: Operations::Operation#as_json
- Defined in:
- lib/operations/operation.rb
#as_json(options = {}) ⇒ Object
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/operations/operation.rb', line 83 def as_json(={}) additional_hash = {uuid: uuid, users_count: users.count} if (methods = [:methods]) if methods.class != Array methods = [methods] end methods.each do |method| begin additional_hash[method] = send(method) rescue NoMethodError # ignore next end end end values .as_json() .merge(additional_hash) .as_json end |