Class: Stripe::Capability
- Inherits:
-
APIResource
- Object
- StripeObject
- APIResource
- Stripe::Capability
- Includes:
- APIOperations::Save
- Defined in:
- lib/stripe/resources/capability.rb
Overview
This is an object representing a capability for a Stripe account.
Related guide: [Account capabilities](stripe.com/docs/connect/account-capabilities)
Defined Under Namespace
Classes: FutureRequirements, Requirements
Constant Summary collapse
- OBJECT_NAME =
"capability"
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary collapse
-
#account ⇒ Object
readonly
The account for which the capability enables functionality.
-
#future_requirements ⇒ Object
readonly
Attribute for field future_requirements.
-
#id ⇒ Object
readonly
The identifier for the capability.
-
#object ⇒ Object
readonly
String representing the object’s type.
-
#requested ⇒ Object
readonly
Whether the capability has been requested.
-
#requested_at ⇒ Object
readonly
Time at which the capability was requested.
-
#requirements ⇒ Object
readonly
Attribute for field requirements.
-
#status ⇒ Object
readonly
The status of the capability.
Attributes inherited from APIResource
Attributes inherited from StripeObject
Class Method Summary collapse
- .object_name ⇒ Object
- .retrieve(_id, _opts = {}) ⇒ Object
- .update(_id, _params = nil, _opts = nil) ⇒ Object
Instance Method Summary collapse
Methods included from APIOperations::Save
Methods inherited from APIResource
class_name, custom_method, #refresh, #request_stripe_object, resource_url, save_nested_resource
Methods included from APIOperations::Request
Methods inherited from StripeObject
#==, #[], #[]=, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values
Constructor Details
This class inherits a constructor from Stripe::StripeObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject
Instance Attribute Details
#account ⇒ Object (readonly)
The account for which the capability enables functionality.
104 105 106 |
# File 'lib/stripe/resources/capability.rb', line 104 def account @account end |
#future_requirements ⇒ Object (readonly)
Attribute for field future_requirements
107 108 109 |
# File 'lib/stripe/resources/capability.rb', line 107 def future_requirements @future_requirements end |
#id ⇒ Object (readonly)
The identifier for the capability.
110 111 112 |
# File 'lib/stripe/resources/capability.rb', line 110 def id @id end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
113 114 115 |
# File 'lib/stripe/resources/capability.rb', line 113 def object @object end |
#requested ⇒ Object (readonly)
Whether the capability has been requested.
116 117 118 |
# File 'lib/stripe/resources/capability.rb', line 116 def requested @requested end |
#requested_at ⇒ Object (readonly)
Time at which the capability was requested. Measured in seconds since the Unix epoch.
119 120 121 |
# File 'lib/stripe/resources/capability.rb', line 119 def requested_at @requested_at end |
#requirements ⇒ Object (readonly)
Attribute for field requirements
122 123 124 |
# File 'lib/stripe/resources/capability.rb', line 122 def requirements @requirements end |
#status ⇒ Object (readonly)
The status of the capability.
125 126 127 |
# File 'lib/stripe/resources/capability.rb', line 125 def status @status end |
Class Method Details
.object_name ⇒ Object
12 13 14 |
# File 'lib/stripe/resources/capability.rb', line 12 def self.object_name "capability" end |
.retrieve(_id, _opts = {}) ⇒ Object
136 137 138 139 140 141 |
# File 'lib/stripe/resources/capability.rb', line 136 def self.retrieve(_id, _opts = {}) raise NotImplementedError, "Capabilities cannot be retrieve without an account ID. " \ "Retrieve a capability using Account.retrieve_capability(" \ "'account_id', 'capability_id')`" end |
.update(_id, _params = nil, _opts = nil) ⇒ Object
143 144 145 146 147 148 |
# File 'lib/stripe/resources/capability.rb', line 143 def self.update(_id, _params = nil, _opts = nil) raise NotImplementedError, "Capabilities cannot be updated without an account ID. Update a " \ "capability using `Account.update_capability('account_id', " \ "'capability_id', update_params)`" end |
Instance Method Details
#resource_url ⇒ Object
127 128 129 130 131 132 133 134 |
# File 'lib/stripe/resources/capability.rb', line 127 def resource_url if !respond_to?(:account) || account.nil? raise NotImplementedError, "Capabilities cannot be accessed without an account ID." end "#{Account.resource_url}/#{CGI.escape(account)}/capabilities" \ "/#{CGI.escape(id)}" end |