Sha256: 5be929f356cb9e5cb55a5da567eea3516e490ee5a25a5c6c791e2a7d930301ea
Contents?: true
Size: 389 Bytes
Versions: 2
Compression:
Stored size: 389 Bytes
Contents
require 'json' module Mac module EventMonitor module JsonSerializable def self.included(klass) klass.instance_eval do def json_create(o) new(*o['data']) end end end def to_json(*a) { 'json_class' => self.class.name, 'data' => data }.to_json(*a) end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
mac-event-monitor-0.2.1 | lib/mac-event-monitor/serializable.rb |
mac-event-monitor-0.2.0 | lib/mac-event-monitor/serializable.rb |