Sha256: 24bd62cb7246737505f687043c5f08aae07004df382b1775b1ca4929735727b8

Contents?: true

Size: 642 Bytes

Versions: 14

Compression:

Stored size: 642 Bytes

Contents

module BillForward
	class InsertableEntity < BillingEntity
		def initialize(*args)
	      raise AbstractInstantiateError.new('This abstract class cannot be instantiated!') if self.class == InsertableEntity
	      super
	    end

		class << self
			# Asks API to create a real instance of specified entity,
	 		# based on provided model.
		    # @param options=nil [self] the Entity to create
		    # 
		    # @return [self] The created Entity
			def create(entity = nil)
				entity = self.new if entity.nil?
				TypeCheck.verifyObj(self, entity, 'entity')

				self.request_first('post', '', entity, nil, entity._client)
			end
		end
	end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
bill_forward-2.2016.241 lib/bill_forward/insertable_entity.rb
bill_forward-2.2016.227 lib/bill_forward/insertable_entity.rb
bill_forward-2.2016.222 lib/bill_forward/insertable_entity.rb
bill_forward-2.2016.209 lib/bill_forward/insertable_entity.rb
bill_forward-1.2016.117 lib/bill_forward/insertable_entity.rb
bill_forward-1.2016.101 lib/bill_forward/insertable_entity.rb
bill_forward-1.2016.26 lib/bill_forward/insertable_entity.rb
bill_forward-1.2015.321.1 lib/bill_forward/insertable_entity.rb
bill_forward-1.2015.321 lib/bill_forward/insertable_entity.rb
bill_forward-1.2015.299 lib/bill_forward/insertable_entity.rb
bill_forward-1.2015.217.1 lib/bill_forward/insertable_entity.rb
bill_forward-1.2015.217 lib/bill_forward/insertable_entity.rb
bill_forward-1.2015.186 lib/bill_forward/insertable_entity.rb
bill_forward-1.2015.183 lib/bill_forward/insertable_entity.rb