Class: Dynomite::Item::Indexes::PrimaryIndex
- Inherits:
-
Object
- Object
- Dynomite::Item::Indexes::PrimaryIndex
- Defined in:
- lib/dynomite/item/indexes/primary_index.rb
Instance Attribute Summary collapse
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
Instance Method Summary collapse
-
#index_name ⇒ Object
primary index is the table itself no name.
-
#initialize(fields) ⇒ PrimaryIndex
constructor
A new instance of PrimaryIndex.
- #primary? ⇒ Boolean
Constructor Details
#initialize(fields) ⇒ PrimaryIndex
Returns a new instance of PrimaryIndex.
4 5 6 |
# File 'lib/dynomite/item/indexes/primary_index.rb', line 4 def initialize(fields) @fields = fields end |
Instance Attribute Details
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
3 4 5 |
# File 'lib/dynomite/item/indexes/primary_index.rb', line 3 def fields @fields end |
Instance Method Details
#index_name ⇒ Object
primary index is the table itself no name. LSI and GSI have names.
10 11 12 |
# File 'lib/dynomite/item/indexes/primary_index.rb', line 10 def index_name "primary_key (fields: #{fields.join(", ")})" end |
#primary? ⇒ Boolean
14 15 16 |
# File 'lib/dynomite/item/indexes/primary_index.rb', line 14 def primary? true end |