Class: Samurai::Base
- Inherits:
-
ActiveResource::Base
- Object
- ActiveResource::Base
- Samurai::Base
- Defined in:
- lib/samurai/base.rb
Overview
Base class that all Samurai ActiveResource models inherit from Provides some common error-handling functionality, as well as the AR site settings
Direct Known Subclasses
Message, PaymentMethod, Processor, ProcessorResponse, Transaction
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.setup_site! ⇒ Object
15 16 17 18 19 |
# File 'lib/samurai/base.rb', line 15 def self.setup_site! self.site = Samurai.site self.user = Samurai.merchant_key self.password = Samurai.merchant_password end |
Instance Method Details
#has_errors? ⇒ Boolean
21 22 23 |
# File 'lib/samurai/base.rb', line 21 def has_errors? respond_to?(:errors) && errors && errors.count > 0 end |