Class: AWSCDK::Expiration
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::Expiration
- Defined in:
- expiration.rb
Overview
Represents a date of expiration.
The amount can be specified either as a Date object, timestamp, Duration or string.
Class Method Summary collapse
-
.after(t) ⇒ AWSCDK::Expiration
Expire once the specified duration has passed since deployment time.
-
.at_date(d) ⇒ AWSCDK::Expiration
Expire at the specified date.
-
.at_timestamp(t) ⇒ AWSCDK::Expiration
Expire at the specified timestamp.
-
.from_string(s) ⇒ AWSCDK::Expiration
Expire at specified date, represented as a string.
- .jsii_overridable_methods ⇒ Object
Instance Method Summary collapse
-
#date ⇒ DateTime
Expiration value as a Date object.
-
#initialize(*args) ⇒ Expiration
constructor
A new instance of Expiration.
-
#is_after(t) ⇒ Boolean
Check if Expiration expires after input.
-
#is_before(t) ⇒ Boolean
Check if Expiration expires before input.
-
#to_epoch ⇒ Numeric
Expiration Value in a formatted Unix Epoch Time in seconds.
Constructor Details
#initialize(*args) ⇒ Expiration
Returns a new instance of Expiration.
10 11 12 |
# File 'expiration.rb', line 10 def initialize(*args) raise NoMethodError, "aws-cdk-lib.Expiration does not have a visible constructor; use the provided factory methods" end |
Class Method Details
.after(t) ⇒ AWSCDK::Expiration
Expire once the specified duration has passed since deployment time.
27 28 29 30 |
# File 'expiration.rb', line 27 def self.after(t) Jsii::Type.check_type(t, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "t") Jsii::Kernel.instance.call_static("aws-cdk-lib.Expiration", "after", [t]) end |
.at_date(d) ⇒ AWSCDK::Expiration
Expire at the specified date.
36 37 38 39 |
# File 'expiration.rb', line 36 def self.at_date(d) Jsii::Type.check_type(d, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJkYXRlIn0=")), "d") Jsii::Kernel.instance.call_static("aws-cdk-lib.Expiration", "atDate", [d]) end |
.at_timestamp(t) ⇒ AWSCDK::Expiration
Expire at the specified timestamp.
45 46 47 48 |
# File 'expiration.rb', line 45 def self.(t) Jsii::Type.check_type(t, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "t") Jsii::Kernel.instance.call_static("aws-cdk-lib.Expiration", "atTimestamp", [t]) end |
.from_string(s) ⇒ AWSCDK::Expiration
Expire at specified date, represented as a string.
54 55 56 57 |
# File 'expiration.rb', line 54 def self.from_string(s) Jsii::Type.check_type(s, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "s") Jsii::Kernel.instance.call_static("aws-cdk-lib.Expiration", "fromString", [s]) end |
.jsii_overridable_methods ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'expiration.rb', line 14 def self.jsii_overridable_methods { :date => { kind: :property, name: "date", is_optional: false }, :is_after => { kind: :method, name: "isAfter", is_optional: false }, :is_before => { kind: :method, name: "isBefore", is_optional: false }, :to_epoch => { kind: :method, name: "toEpoch", is_optional: false }, } end |
Instance Method Details
#date ⇒ DateTime
Expiration value as a Date object.
62 63 64 |
# File 'expiration.rb', line 62 def date() jsii_get_property("date") end |
#is_after(t) ⇒ Boolean
Check if Expiration expires after input.
70 71 72 73 |
# File 'expiration.rb', line 70 def is_after(t) Jsii::Type.check_type(t, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "t") jsii_call_method("isAfter", [t]) end |
#is_before(t) ⇒ Boolean
Check if Expiration expires before input.
79 80 81 82 |
# File 'expiration.rb', line 79 def is_before(t) Jsii::Type.check_type(t, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "t") jsii_call_method("isBefore", [t]) end |
#to_epoch ⇒ Numeric
Expiration Value in a formatted Unix Epoch Time in seconds.
87 88 89 |
# File 'expiration.rb', line 87 def to_epoch() jsii_call_method("toEpoch", []) end |