Class: Recurly::Redemption
- Defined in:
- lib/recurly/redemption.rb
Overview
Redemptions are not top-level resources, but they can be accessed (and created) through Coupon instances.
Instance Attribute Summary
Attributes inherited from Resource
#attributes, #etag, #response, #uri
Instance Method Summary collapse
Methods inherited from Resource
#==, all, associations, belongs_to, #changed, #changed?, #changed_attributes, #changes, collection_name, count, create, create!, define_attribute_methods, #destroy, #destroyed?, embedded!, #errors, find, find_each, first, from_response, from_xml, has_many, has_one, #initialize, #inspect, member_name, member_path, #new_record?, paginate, #persist!, #persisted?, #previous_changes, #read_attribute, reflect_on_association, #reload, resource_name, #save!, scope, scopes, #to_param, #to_xml, #update_attributes, #update_attributes!, #valid?, #write_attribute
Constructor Details
This class inherits a constructor from Recurly::Resource
Instance Method Details
#account ⇒ Account
13 |
# File 'lib/recurly/redemption.rb', line 13 belongs_to :account, :readonly => false |
#save ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/recurly/redemption.rb', line 22 def save return false if persisted? copy_from coupon.redeem account, currency true rescue Recurly::API::UnprocessableEntity => e apply_errors e false end |