Class: Stripe::EphemeralKey
- Inherits:
-
APIResource
- Object
- StripeObject
- APIResource
- Stripe::EphemeralKey
- Extended by:
- APIOperations::Create
- Includes:
- APIOperations::Delete
- Defined in:
- lib/stripe/resources/ephemeral_key.rb
Defined Under Namespace
Classes: DeleteParams
Constant Summary collapse
- OBJECT_NAME =
"ephemeral_key"
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary collapse
-
#created ⇒ Object
readonly
Time at which the object was created.
-
#expires ⇒ Object
readonly
Time at which the key will expire.
-
#id ⇒ Object
readonly
Unique identifier for the object.
-
#livemode ⇒ Object
readonly
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
-
#object ⇒ Object
readonly
String representing the object’s type.
-
#secret ⇒ Object
readonly
The key’s secret.
Attributes inherited from APIResource
Attributes inherited from StripeObject
Class Method Summary collapse
- .create(params = {}, opts = {}) ⇒ Object
-
.delete(id, params = {}, opts = {}) ⇒ Object
Invalidates a short-lived API key for a given resource.
- .object_name ⇒ Object
Instance Method Summary collapse
-
#delete(params = {}, opts = {}) ⇒ Object
Invalidates a short-lived API key for a given resource.
Methods included from APIOperations::Create
Methods included from APIOperations::Delete
Methods inherited from APIResource
class_name, custom_method, #refresh, #request_stripe_object, resource_url, #resource_url, retrieve, 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
#created ⇒ Object (readonly)
Time at which the object was created. Measured in seconds since the Unix epoch.
23 24 25 |
# File 'lib/stripe/resources/ephemeral_key.rb', line 23 def created @created end |
#expires ⇒ Object (readonly)
Time at which the key will expire. Measured in seconds since the Unix epoch.
26 27 28 |
# File 'lib/stripe/resources/ephemeral_key.rb', line 26 def expires @expires end |
#id ⇒ Object (readonly)
Unique identifier for the object.
29 30 31 |
# File 'lib/stripe/resources/ephemeral_key.rb', line 29 def id @id end |
#livemode ⇒ Object (readonly)
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
32 33 34 |
# File 'lib/stripe/resources/ephemeral_key.rb', line 32 def livemode @livemode end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
35 36 37 |
# File 'lib/stripe/resources/ephemeral_key.rb', line 35 def object @object end |
#secret ⇒ Object (readonly)
The key’s secret. You can use this value to make authorized requests to the Stripe API.
38 39 40 |
# File 'lib/stripe/resources/ephemeral_key.rb', line 38 def secret @secret end |
Class Method Details
.create(params = {}, opts = {}) ⇒ Object
60 61 62 63 64 65 66 67 |
# File 'lib/stripe/resources/ephemeral_key.rb', line 60 def self.create(params = {}, opts = {}) opts = Util.normalize_opts(opts) unless opts[:stripe_version] raise ArgumentError, "stripe_version must be specified to create an ephemeral key" end super end |
.delete(id, params = {}, opts = {}) ⇒ Object
Invalidates a short-lived API key for a given resource.
41 42 43 44 45 46 47 48 |
# File 'lib/stripe/resources/ephemeral_key.rb', line 41 def self.delete(id, params = {}, opts = {}) request_stripe_object( method: :delete, path: format("/v1/ephemeral_keys/%<id>s", { id: CGI.escape(id) }), params: params, opts: opts ) end |
.object_name ⇒ Object
10 11 12 |
# File 'lib/stripe/resources/ephemeral_key.rb', line 10 def self.object_name "ephemeral_key" end |
Instance Method Details
#delete(params = {}, opts = {}) ⇒ Object
Invalidates a short-lived API key for a given resource.
51 52 53 54 55 56 57 58 |
# File 'lib/stripe/resources/ephemeral_key.rb', line 51 def delete(params = {}, opts = {}) request_stripe_object( method: :delete, path: format("/v1/ephemeral_keys/%<key>s", { key: CGI.escape(self["id"]) }), params: params, opts: opts ) end |