Class: SeapigWildcardObject

Inherits:
SeapigObject show all
Defined in:
lib/seapig/client.rb

Instance Attribute Summary

Attributes inherited from SeapigObject

#destroyed, #object_id, #onproduce_proc, #parent, #stall, #valid, #version

Instance Method Summary collapse

Methods inherited from SeapigObject

#changed, #initialize, #matches?, #onchange, #onproduce, #sanitized, #set, #upload

Constructor Details

This class inherits a constructor from SeapigObject

Instance Method Details

#destroy(message) ⇒ Object



279
280
281
282
283
284
# File 'lib/seapig/client.rb', line 279

def destroy(message)
	if destroyed = self.delete(message['id'])
		destroyed.destroyed = true
		@onchange_proc.call(destroyed) if @onchange_proc
	end
end

#patch(message) ⇒ Object



271
272
273
274
275
276
# File 'lib/seapig/client.rb', line 271

def patch(message)
	self[message['id']] ||= SeapigObject.new(@server, message['id'], self)
	self[message['id']].patch(message)
#		puts JSON.dump(self)
	@onchange_proc.call(self[message['id']]) if @onchange_proc
end