ruby-hyperloop / hyper-mesh

The project has moved to Hyperstack!! - Synchronization of active record models across multiple clients using Pusher, ActionCable, or Polling
https://hyperstack.org/
MIT License
22 stars 12 forks source link

add slice method to ActiveRecord models #36

Open catmando opened 7 years ago

catmando commented 7 years ago

Adapted from active record:

module ActiveRecord
  module InstanceMethods
    def slice(methods)
      Hash[methods.map! { |method| [method, send(method)] }]
    end
  end
end