Class: AWSCDK::DynamoDB::Attribute
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::DynamoDB::Attribute
- Defined in:
- dynamo_db/attribute.rb
Overview
Represents an attribute for describing the key schema for the table and indexes.
Instance Attribute Summary collapse
-
#name ⇒ String
readonly
The name of an attribute.
-
#type ⇒ AWSCDK::DynamoDB::AttributeType
readonly
The data type of an attribute.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name:, type:) ⇒ Attribute
constructor
A new instance of Attribute.
- #to_jsii ⇒ Object
Constructor Details
#initialize(name:, type:) ⇒ Attribute
Returns a new instance of Attribute.
9 10 11 12 13 14 |
# File 'dynamo_db/attribute.rb', line 9 def initialize(name:, type:) @name = name Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") @type = type Jsii::Type.check_type(@type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZHluYW1vZGIuQXR0cmlidXRlVHlwZSJ9")), "type") end |
Instance Attribute Details
#name ⇒ String (readonly)
The name of an attribute.
19 20 21 |
# File 'dynamo_db/attribute.rb', line 19 def name @name end |
#type ⇒ AWSCDK::DynamoDB::AttributeType (readonly)
The data type of an attribute.
23 24 25 |
# File 'dynamo_db/attribute.rb', line 23 def type @type end |
Class Method Details
.jsii_properties ⇒ Object
25 26 27 28 29 30 |
# File 'dynamo_db/attribute.rb', line 25 def self.jsii_properties { :name => "name", :type => "type", } end |
Instance Method Details
#to_jsii ⇒ Object
32 33 34 35 36 37 38 39 |
# File 'dynamo_db/attribute.rb', line 32 def to_jsii result = {} result.merge!({ "name" => @name, "type" => @type, }) result.compact end |