Class: DPay::ReturnUrls
- Inherits:
-
Object
- Object
- DPay::ReturnUrls
- Defined in:
- lib/dpay/payment/return_urls.rb,
sig/dpay/payment/return_urls.rbs
Constant Summary collapse
- HTTP_URL =
%r{\Ahttps?://[^\s]+\z}
Instance Attribute Summary collapse
-
#fail ⇒ String
readonly
Returns the value of attribute fail.
-
#ipn ⇒ String
readonly
Returns the value of attribute ipn.
-
#success ⇒ String
readonly
Returns the value of attribute success.
Instance Method Summary collapse
-
#initialize(success, fail, ipn) ⇒ ReturnUrls
constructor
A new instance of ReturnUrls.
Constructor Details
#initialize(success, fail, ipn) ⇒ ReturnUrls
Returns a new instance of ReturnUrls.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/dpay/payment/return_urls.rb', line 9 def initialize(success, fail, ipn) { "success" => success, "fail" => fail, "ipn" => ipn }.each do |name, url| raise InvalidArgumentError, %(Invalid #{name} URL "#{url}") unless url.is_a?(String) && HTTP_URL.match?(url) end @success = success @fail = fail @ipn = ipn freeze end |
Instance Attribute Details
#fail ⇒ String (readonly)
Returns the value of attribute fail.
7 8 9 |
# File 'lib/dpay/payment/return_urls.rb', line 7 def fail @fail end |
#ipn ⇒ String (readonly)
Returns the value of attribute ipn.
7 8 9 |
# File 'lib/dpay/payment/return_urls.rb', line 7 def ipn @ipn end |
#success ⇒ String (readonly)
Returns the value of attribute success.
7 8 9 |
# File 'lib/dpay/payment/return_urls.rb', line 7 def success @success end |