Class: Centaman::Service::CouponCheck
- Inherits:
-
Centaman::Service
- Object
- Wrapper
- Centaman::Service
- Centaman::Service::CouponCheck
- Includes:
- JsonWrapper
- Defined in:
- lib/centaman/service/coupon_check.rb
Constant Summary
Constants inherited from Centaman::Service
Constants inherited from Wrapper
Instance Attribute Summary collapse
-
#coupon_code ⇒ Object
readonly
Returns the value of attribute coupon_code.
Attributes inherited from Wrapper
#api_password, #api_token, #api_username
Instance Method Summary collapse
- #after_init(args) ⇒ Object
- #endpoint ⇒ Object
- #object_class ⇒ Object
- #options_hash ⇒ Object
- #require_args ⇒ Object
Methods included from JsonWrapper
#additional_hash_to_serialize_after_response, #build_object, #build_objects, #objects
Methods inherited from Centaman::Service
#after_post, #fetch_all, #payload, #payload_key, #post, #wrap_request_in_case_of_timeout
Methods inherited from Wrapper
#generate_token, #headers, #initialize, #options
Constructor Details
This class inherits a constructor from Centaman::Wrapper
Instance Attribute Details
#coupon_code ⇒ Object (readonly)
Returns the value of attribute coupon_code.
4 5 6 |
# File 'lib/centaman/service/coupon_check.rb', line 4 def coupon_code @coupon_code end |
Instance Method Details
#after_init(args) ⇒ Object
6 7 8 9 |
# File 'lib/centaman/service/coupon_check.rb', line 6 def after_init(args) @coupon_code = args[:coupon_code] require_args end |
#endpoint ⇒ Object
11 12 13 |
# File 'lib/centaman/service/coupon_check.rb', line 11 def endpoint '/coupon_services/check' end |
#object_class ⇒ Object
15 16 17 |
# File 'lib/centaman/service/coupon_check.rb', line 15 def object_class Centaman::Object::CouponCheck end |
#options_hash ⇒ Object
19 20 21 22 23 24 |
# File 'lib/centaman/service/coupon_check.rb', line 19 def { 'CouponCode' => coupon_code, 'ProductArea' => 'TimedTickets' }.to_json end |
#require_args ⇒ Object
26 27 28 |
# File 'lib/centaman/service/coupon_check.rb', line 26 def require_args raise "coupon_code is required for #{self.class.name}" if coupon_code.nil? end |