Class: Dynomite::Item::Indexes::PrimaryIndex

Inherits:
Object
  • Object
show all
Defined in:
lib/dynomite/item/indexes/primary_index.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#fieldsObject (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_nameObject

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

Returns:

  • (Boolean)


14
15
16
# File 'lib/dynomite/item/indexes/primary_index.rb', line 14

def primary?
  true
end