Class: Dyna::DSL::DynamoDB::Table::LocalSecondaryIndex
- Inherits:
-
Object
- Object
- Dyna::DSL::DynamoDB::Table::LocalSecondaryIndex
- Defined in:
- lib/dyna/dsl/table.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#result ⇒ Object
Returns the value of attribute result.
Instance Method Summary collapse
-
#initialize ⇒ LocalSecondaryIndex
constructor
A new instance of LocalSecondaryIndex.
- #key_schema(hash:, range: nil) ⇒ Object
- #projection(projection_type:, non_key_attributes: nil) ⇒ Object
Constructor Details
#initialize ⇒ LocalSecondaryIndex
Returns a new instance of LocalSecondaryIndex.
117 118 119 |
# File 'lib/dyna/dsl/table.rb', line 117 def initialize @result = Hashie::Mash.new end |
Instance Attribute Details
#result ⇒ Object
Returns the value of attribute result.
115 116 117 |
# File 'lib/dyna/dsl/table.rb', line 115 def result @result end |
Instance Method Details
#key_schema(hash:, range: nil) ⇒ Object
121 122 123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/dyna/dsl/table.rb', line 121 def key_schema(hash:, range: nil) @result.key_schema = [{ attribute_name: hash, key_type: 'HASH', }] if range @result.key_schema << { attribute_name: range, key_type: 'RANGE', } end end |
#projection(projection_type:, non_key_attributes: nil) ⇒ Object
135 136 137 138 139 140 |
# File 'lib/dyna/dsl/table.rb', line 135 def projection(projection_type:, non_key_attributes: nil) @result.projection = { projection_type: projection_type, non_key_attributes: non_key_attributes, } end |