Class: PagSeguro::SubscriptionChangeStatus
- Inherits:
-
Object
- Object
- PagSeguro::SubscriptionChangeStatus
- Defined in:
- lib/pagseguro/subscription_change_status.rb,
lib/pagseguro/subscription_change_status/response.rb,
lib/pagseguro/subscription_change_status/request_serializer.rb
Defined Under Namespace
Classes: RequestSerializer, Response
Constant Summary collapse
- STATUSES =
Now, just available ACTIVE and SUSPENDED
{ active: 'ACTIVE', suspended: 'SUSPENDED' }
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Subscription’s code that will be changed.
-
#status ⇒ Object
readonly
The status that will be set.
Attributes included from Extensions::Credentiable
Instance Method Summary collapse
-
#errors ⇒ Object
Set errors.
-
#initialize(code, status) ⇒ SubscriptionChangeStatus
constructor
A new instance of SubscriptionChangeStatus.
- #save ⇒ Object
- #status_text ⇒ Object
Constructor Details
#initialize(code, status) ⇒ SubscriptionChangeStatus
Returns a new instance of SubscriptionChangeStatus.
18 19 20 21 |
# File 'lib/pagseguro/subscription_change_status.rb', line 18 def initialize(code, status) @code = code @status = status end |
Instance Attribute Details
#code ⇒ Object (readonly)
Subscription’s code that will be changed
13 14 15 |
# File 'lib/pagseguro/subscription_change_status.rb', line 13 def code @code end |
#status ⇒ Object (readonly)
The status that will be set
16 17 18 |
# File 'lib/pagseguro/subscription_change_status.rb', line 16 def status @status end |
Instance Method Details
#errors ⇒ Object
Set errors
24 25 26 |
# File 'lib/pagseguro/subscription_change_status.rb', line 24 def errors @errors ||= Errors.new end |
#save ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/pagseguro/subscription_change_status.rb', line 28 def save request = Request.put_xml("pre-approvals/#{code}/status", credentials, params) Response.new(request, self).serialize self end |
#status_text ⇒ Object
36 37 38 |
# File 'lib/pagseguro/subscription_change_status.rb', line 36 def status_text STATUSES[status] end |