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
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(key, params = {}, opts = {}) ⇒ Object
Invalidates a short-lived API key for a given resource.
- .field_remappings ⇒ Object
- .inner_class_types ⇒ Object
- .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
#==, #[], #[]=, #_get_inner_class_type, 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.
15 16 17 |
# File 'lib/stripe/resources/ephemeral_key.rb', line 15 def created @created end |
#expires ⇒ Object (readonly)
Time at which the key will expire. Measured in seconds since the Unix epoch.
17 18 19 |
# File 'lib/stripe/resources/ephemeral_key.rb', line 17 def expires @expires end |
#id ⇒ Object (readonly)
Unique identifier for the object.
19 20 21 |
# File 'lib/stripe/resources/ephemeral_key.rb', line 19 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.
21 22 23 |
# File 'lib/stripe/resources/ephemeral_key.rb', line 21 def livemode @livemode end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
23 24 25 |
# File 'lib/stripe/resources/ephemeral_key.rb', line 23 def object @object end |
#secret ⇒ Object (readonly)
The key’s secret. You can use this value to make authorized requests to the Stripe API.
25 26 27 |
# File 'lib/stripe/resources/ephemeral_key.rb', line 25 def secret @secret end |
Class Method Details
.create(params = {}, opts = {}) ⇒ Object
47 48 49 50 51 52 53 54 |
# File 'lib/stripe/resources/ephemeral_key.rb', line 47 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(key, params = {}, opts = {}) ⇒ Object
Invalidates a short-lived API key for a given resource.
28 29 30 31 32 33 34 35 |
# File 'lib/stripe/resources/ephemeral_key.rb', line 28 def self.delete(key, params = {}, opts = {}) request_stripe_object( method: :delete, path: format("/v1/ephemeral_keys/%<key>s", { key: CGI.escape(key) }), params: params, opts: opts ) end |
.field_remappings ⇒ Object
60 61 62 |
# File 'lib/stripe/resources/ephemeral_key.rb', line 60 def self.field_remappings @field_remappings = {} end |
.inner_class_types ⇒ Object
56 57 58 |
# File 'lib/stripe/resources/ephemeral_key.rb', line 56 def self.inner_class_types @inner_class_types = {} 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.
38 39 40 41 42 43 44 45 |
# File 'lib/stripe/resources/ephemeral_key.rb', line 38 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 |