adelevie/parse-ruby-client

View on GitHub
lib/parse/model.rb

Summary

Maintainability
A
0 mins
Test Coverage
# encoding: utf-8
module Parse
  # A meta object to find objects by object id
  class Model < Parse::Object
    def initialize(data = nil, parse_client = nil)
      super(self.class.to_s, data, parse_client || Parse.client)
    end

    def self.find(object_id, client = nil)
      data = Parse::Query.new(to_s, client).eq('objectId', object_id).first
      new(data, client)
    end
  end
end