Class: Dynamocli::AWS::Table

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/dynamocli/aws/table.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table_name:, table_on_aws:, dynamodb: nil) ⇒ Table

Returns a new instance of Table.



13
14
15
16
17
18
19
# File 'lib/dynamocli/aws/table.rb', line 13

def initialize(table_name:, table_on_aws:, dynamodb: nil)
  @table_name = table_name
  @table_on_aws = table_on_aws
  @dynamodb = dynamodb || DYNAMODB.new

  set_schema_before_we_delete_the_table
end

Instance Attribute Details

#schemaObject (readonly)

Returns the value of attribute schema.



8
9
10
# File 'lib/dynamocli/aws/table.rb', line 8

def schema
  @schema
end

Instance Method Details

#deleting?Boolean

Returns:

  • (Boolean)


21
22
23
24
25
# File 'lib/dynamocli/aws/table.rb', line 21

def deleting?
  status == DELETION_IN_PROCESSING_KEY
rescue Aws::DynamoDB::Errors::ResourceNotFoundException
  false
end