Sha256: 3e07435b4b6d15430168f4891f0a22cbf88eca966f4d211798bda2b9870d3e81

Contents?: true

Size: 1.18 KB

Versions: 4

Compression:

Stored size: 1.18 KB

Contents

require 'osc_ruby/client'
require 'osc_ruby/query_module'
require 'osc_ruby/validations_module'
require 'osc_ruby/class_factory_module'
require 'json'
require 'uri'
require_relative '../ext/string'

module OSCRuby
	
	class ServiceClass

		include QueryModule
		include ValidationsModule
		include ClassFactoryModule

	    def self.url

	    	self.to_s.split('::')[1].camel_case_lower

	    end
	    
	    def create(client,return_json = false)

	    	ClassFactoryModule.create(client,self,self.class.url,return_json)

	    end

	    
	    def self.find(client,id = nil,return_json = false)

	    	ClassFactoryModule.find(client,id,url,return_json,self)

	    end

	    
	    def self.all(client, return_json = false)

	    	ClassFactoryModule.all(client,url,return_json,self)

	    end

	    
	    def self.where(client, query = '', return_json = false)

			ClassFactoryModule.where(client,query,url,return_json,self)

	    end

    
	    def update(client, return_json = false)

	    	ClassFactoryModule::update(client,self,self.class.url,return_json)

	    end


	    def destroy(client, return_json = false)

	    	ClassFactoryModule.destroy(client,self,self.class.url,return_json)

	    end

	end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
osc_ruby-0.5.2 lib/osc_ruby/service_class.rb
osc_ruby-0.5.1 lib/osc_ruby/service_class.rb
osc_ruby-0.5.0 lib/osc_ruby/service_class.rb
osc_ruby-0.4.0 lib/osc_ruby/service_class.rb