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 Wrapper
Instance Attribute Summary collapse
-
#coupon_code ⇒ Object
readonly
Returns the value of attribute coupon_code.
-
#product_area ⇒ Object
readonly
Returns the value of attribute product_area.
Attributes inherited from Wrapper
#api_password, #api_token, #api_url, #api_username, #proxie_host, #proxie_password, #proxie_port, #proxie_user
Instance Method Summary collapse
- #after_init(args) ⇒ Object
- #endpoint ⇒ Object
- #object_class ⇒ Object
- #options_hash ⇒ Object
- #require_args ⇒ Object
- #required_fields ⇒ Object
Methods included from JsonWrapper
#additional_hash_to_serialize_after_response, #build_object, #build_objects, #final_object_class, #objects
Methods inherited from Centaman::Service
#after_post, #fetch_all, #post, #put
Methods inherited from Wrapper
#generate_token, #headers, #initialize, #options, #payload, #payload_key, #proxy_hash, #wrap_request_in_case_of_timeout
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 |
#product_area ⇒ Object (readonly)
Returns the value of attribute product_area.
4 5 6 |
# File 'lib/centaman/service/coupon_check.rb', line 4 def product_area @product_area end |
Instance Method Details
#after_init(args) ⇒ Object
6 7 8 9 10 |
# File 'lib/centaman/service/coupon_check.rb', line 6 def after_init(args) @coupon_code = args[:coupon_code] @product_area = args[:product_area] require_args end |
#endpoint ⇒ Object
12 13 14 |
# File 'lib/centaman/service/coupon_check.rb', line 12 def endpoint '/coupon_services/check' end |
#object_class ⇒ Object
16 17 18 |
# File 'lib/centaman/service/coupon_check.rb', line 16 def object_class Centaman::Object::CouponCheck end |
#options_hash ⇒ Object
20 21 22 23 24 25 |
# File 'lib/centaman/service/coupon_check.rb', line 20 def { 'CouponCode' => coupon_code, 'ProductArea' => product_area }.to_json end |
#require_args ⇒ Object
31 32 33 |
# File 'lib/centaman/service/coupon_check.rb', line 31 def require_args raise "coupon_code and product_area required for #{self.class.name}" if required_fields.include?(nil) end |
#required_fields ⇒ Object
27 28 29 |
# File 'lib/centaman/service/coupon_check.rb', line 27 def required_fields [coupon_code, product_area] end |