lib/recurly/resources/coupon.rb in recurly-3.0.0.beta.4 vs lib/recurly/resources/coupon.rb in recurly-3.0.0.beta.5

- old
+ new

@@ -18,23 +18,23 @@ # @return [String] The code the customer enters to redeem the coupon. define_attribute :code, String # @!attribute coupon_type # @return [String] Whether the coupon is "single_code" or "bulk". Bulk coupons will require a `unique_code_template` and will generate unique codes through the `/generate` endpoint. - define_attribute :coupon_type, String, { :enum => ["single_code", "bulk"] } + define_attribute :coupon_type, String - # @!attribute [r] created_at + # @!attribute created_at # @return [DateTime] Created at - define_attribute :created_at, DateTime, { :read_only => true } + define_attribute :created_at, DateTime # @!attribute discount # @return [CouponDiscount] define_attribute :discount, :CouponDiscount # @!attribute duration # @return [String] - "single_use" coupons applies to the first invoice only. - "temporal" coupons will apply to invoices for the duration determined by the `temporal_unit` and `temporal_amount` attributes. - define_attribute :duration, String, { :enum => ["forever", "single_use", "temporal"] } + define_attribute :duration, String # @!attribute expired_at # @return [DateTime] The date and time the coupon was expired early or reached its `max_redemptions`. define_attribute :expired_at, DateTime @@ -42,19 +42,19 @@ # @return [Integer] Sets the duration of time the `free_trial_unit` is for. define_attribute :free_trial_amount, Integer # @!attribute free_trial_unit # @return [String] Description of the unit of time the coupon is for. Used with `free_trial_amount` to determine the duration of time the coupon is for. - define_attribute :free_trial_unit, String, { :enum => ["day", "week", "month"] } + define_attribute :free_trial_unit, String # @!attribute hosted_page_description # @return [String] This description will show up when a customer redeems a coupon on your Hosted Payment Pages, or if you choose to show the description on your own checkout page. define_attribute :hosted_page_description, String - # @!attribute [r] id + # @!attribute id # @return [String] Coupon ID - define_attribute :id, String, { :read_only => true } + define_attribute :id, String # @!attribute invoice_description # @return [String] Description of the coupon on the invoice. define_attribute :invoice_description, String @@ -68,13 +68,13 @@ # @!attribute name # @return [String] The internal name for the coupon. define_attribute :name, String - # @!attribute [r] object + # @!attribute object # @return [String] Object type - define_attribute :object, String, { :read_only => true } + define_attribute :object, String # @!attribute plans # @return [Array[PlanMini]] Plans define_attribute :plans, Array, { :item_type => :PlanMini } @@ -86,33 +86,33 @@ # @return [DateTime] The date and time the coupon will expire and can no longer be redeemed. Time is always 11:59:59, the end-of-day Pacific time. define_attribute :redeem_by, DateTime # @!attribute redemption_resource # @return [String] Whether the discount is for all eligible charges on the account, or only a specific subscription. - define_attribute :redemption_resource, String, { :enum => ["account", "subscription"] } + define_attribute :redemption_resource, String # @!attribute state # @return [String] Indicates if the coupon is redeemable, and if it is not, why. - define_attribute :state, String, { :enum => ["redeemable", "maxed_out", "expired"] } + define_attribute :state, String # @!attribute temporal_amount # @return [Integer] If `duration` is "temporal" than `temporal_amount` is an integer which is multiplied by `temporal_unit` to define the duration that the coupon will be applied to invoices for. define_attribute :temporal_amount, Integer # @!attribute temporal_unit # @return [String] If `duration` is "temporal" than `temporal_unit` is multiplied by `temporal_amount` to define the duration that the coupon will be applied to invoices for. - define_attribute :temporal_unit, String, { :enum => ["day", "week", "month", "year"] } + define_attribute :temporal_unit, String # @!attribute unique_code_template # @return [String] On a bulk coupon, the template from which unique coupon codes are generated. define_attribute :unique_code_template, String - # @!attribute [r] unique_coupon_codes_count + # @!attribute unique_coupon_codes_count # @return [Integer] When this number reaches `max_redemptions` the coupon will no longer be redeemable. - define_attribute :unique_coupon_codes_count, Integer, { :read_only => true } + define_attribute :unique_coupon_codes_count, Integer - # @!attribute [r] updated_at + # @!attribute updated_at # @return [DateTime] Last updated at - define_attribute :updated_at, DateTime, { :read_only => true } + define_attribute :updated_at, DateTime end end end