Class: Webhookdb::DBAdapter::Partition

Inherits:
TypedStruct show all
Defined in:
lib/webhookdb/db_adapter/partition.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from TypedStruct

#[], #_apply, #_defaults, #as_json, #change

Constructor Details

#initialize(**kwargs) ⇒ Partition

Returns a new instance of Partition.



6
7
8
9
10
11
# File 'lib/webhookdb/db_adapter/partition.rb', line 6

def initialize(**kwargs)
  super
  self.typecheck!(:parent_table, Webhookdb::DBAdapter::Table)
  self.typecheck!(:partition_name, Symbol)
  self.typecheck!(:suffix, Symbol)
end

Instance Attribute Details

#parent_tableObject (readonly)

Returns the value of attribute parent_table.



4
5
6
# File 'lib/webhookdb/db_adapter/partition.rb', line 4

def parent_table
  @parent_table
end

#partition_nameObject (readonly)

Returns the value of attribute partition_name.



4
5
6
# File 'lib/webhookdb/db_adapter/partition.rb', line 4

def partition_name
  @partition_name
end

#suffixObject (readonly)

Returns the value of attribute suffix.



4
5
6
# File 'lib/webhookdb/db_adapter/partition.rb', line 4

def suffix
  @suffix
end

Instance Method Details

#partition_tableObject



13
# File 'lib/webhookdb/db_adapter/partition.rb', line 13

def partition_table = Webhookdb::DBAdapter::Table.new(name: self.partition_name, schema: self.parent_table.schema)