Sha256: 656d66acfb9351ede51391287708caef5a1c9b76e738725244537c59f0c29f52

Contents?: true

Size: 504 Bytes

Versions: 55

Compression:

Stored size: 504 Bytes

Contents

class Auth::Transaction::Status
	
	include Mongoid::Document
	include Mongoid::Timestamps

	ALLOW_TO_CONTINUE_IN_SECONDS = 300

	## "PROCESSING"
	## "COMPLETE"
	## "FAILED"
	field :condition, type: String
	embedded_in :event, :class_name => "Auth::Transaction::Event"
	

	def is_complete?
		self.condition == "COMPLETED"
	end

	def is_processing?
		self.condition == "PROCESSING" && (Time.now - self.updated_at) < ALLOW_TO_CONTINUE_IN_SECONDS
	end

	def is_failed?
		self.condition == "FAILED" 
	end

end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
wordjelly-auth-1.6.0 app/models/auth/transaction/status.rb
wordjelly-auth-1.5.9 app/models/auth/transaction/status.rb
wordjelly-auth-1.5.8 app/models/auth/transaction/status.rb
wordjelly-auth-1.5.7 app/models/auth/transaction/status.rb
wordjelly-auth-1.5.6 app/models/auth/transaction/status.rb
wordjelly-auth-1.5.5 app/models/auth/transaction/status.rb
wordjelly-auth-1.5.4 app/models/auth/transaction/status.rb
wordjelly-auth-1.5.3 app/models/auth/transaction/status.rb
wordjelly-auth-1.5.2 app/models/auth/transaction/status.rb
wordjelly-auth-1.5.1 app/models/auth/transaction/status.rb
wordjelly-auth-1.5.0 app/models/auth/transaction/status.rb
wordjelly-auth-1.4.9 app/models/auth/transaction/status.rb
wordjelly-auth-1.4.8 app/models/auth/transaction/status.rb
wordjelly-auth-1.4.7 app/models/auth/transaction/status.rb
wordjelly-auth-1.4.6 app/models/auth/transaction/status.rb
wordjelly-auth-1.4.5 app/models/auth/transaction/status.rb
wordjelly-auth-1.4.4 app/models/auth/transaction/status.rb
wordjelly-auth-1.4.3 app/models/auth/transaction/status.rb
wordjelly-auth-1.4.2 app/models/auth/transaction/status.rb
wordjelly-auth-1.4.0 app/models/auth/transaction/status.rb