Class: Webhookdb::Replicator::FakeWithEnrichments

Inherits:
Fake
  • Object
show all
Defined in:
lib/webhookdb/replicator/fake.rb

Constant Summary

Constants inherited from Base

Base::MAX_INDEX_NAME_LENGTH

Constants included from DBAdapter::ColumnTypes

DBAdapter::ColumnTypes::BIGINT, DBAdapter::ColumnTypes::BIGINT_ARRAY, DBAdapter::ColumnTypes::BOOLEAN, DBAdapter::ColumnTypes::COLUMN_TYPES, DBAdapter::ColumnTypes::DATE, DBAdapter::ColumnTypes::DECIMAL, DBAdapter::ColumnTypes::DOUBLE, DBAdapter::ColumnTypes::FLOAT, DBAdapter::ColumnTypes::INTEGER, DBAdapter::ColumnTypes::INTEGER_ARRAY, DBAdapter::ColumnTypes::OBJECT, DBAdapter::ColumnTypes::TEXT, DBAdapter::ColumnTypes::TEXT_ARRAY, DBAdapter::ColumnTypes::TIMESTAMP, DBAdapter::ColumnTypes::UUID

Instance Attribute Summary

Attributes inherited from Base

#service_integration

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Fake

_descriptor, #_extra_index_specs, #_fetch_backfill_page, #_remote_key_column, #_resource_and_event, #_timestamp_column_name, #_update_where_expr, #_webhook_response, #calculate_backfill_state_machine, #calculate_webhook_state_machine, #dispatch_request_to, #preprocess_headers_for_logging, #process_webhooks_synchronously?, #requires_sequence?, reset, stub_backfill_request, #synchronous_processing_response_body, #upsert_has_deps?

Methods included from MethodUtilities

#attr_predicate, #attr_predicate_accessor, #singleton_attr_accessor, #singleton_attr_reader, #singleton_attr_writer, #singleton_method_alias, #singleton_predicate_accessor, #singleton_predicate_reader

Methods inherited from Base

#_any_subscriptions_to_notify?, #_backfill_state_change_fields, #_backfillers, #_clear_backfill_information, #_clear_webook_information, #_coalesce_excluded_on_update, #_enqueue_backfill_jobs, #_extra_index_specs, #_find_dependency_candidate, #_notify_dependents, #_parallel_backfill, #_prepare_for_insert, #_publish_rowupsert, #_remote_key_column, #_resource_and_event, #_resource_to_data, #_timestamp_column_name, #_to_json, #_update_where_expr, #_upsert_conflict_target, #_upsert_update_expr, #_upsert_webhook, #_upsert_webhook_single_resource, #_verify_backfill_err_msg, #_webhook_response, #_webhook_state_change_fields, #admin_dataset, #avoid_writes?, #backfill, #backfill_not_supported_message, #calculate_and_backfill_state_machine, #calculate_backfill_state_machine, #calculate_dependency_state_machine_step, #calculate_preferred_create_state_machine, #calculate_webhook_state_machine, chunked_row_update_bounds, #clear_backfill_information, #clear_webhook_information, #create_table, #create_table_modification, #create_table_partitions, #data_column, #dbadapter_table, #denormalized_columns, #descriptor, #dispatch_request_to, #documentation_url, #enqueue_sync_targets, #enrichment_column, #ensure_all_columns, #ensure_all_columns_modification, #existing_partitions, #find_dependent, #find_dependent!, #indices, #initialize, #on_backfill_error, #on_dependency_webhook_upsert, #partition?, #partitioning, #preferred_create_state_machine_method, #preprocess_headers_for_logging, #primary_key_column, #process_state_change, #process_webhooks_synchronously?, #qualified_table_sequel_identifier, #readonly_dataset, #remote_key_column, #requires_sequence?, #resource_name_plural, #resource_name_singular, #schema_and_table_symbols, #storable_columns, #synchronous_processing_response_body, #timestamp_column, #upsert_has_deps?, #upsert_webhook, #upsert_webhook_body, #verify_backfill_credentials, #webhook_endpoint, #webhook_response, #with_advisory_lock

Constructor Details

This class inherits a constructor from Webhookdb::Replicator::Base

Class Method Details

.descriptorObject



156
# File 'lib/webhookdb/replicator/fake.rb', line 156

def self.descriptor = self._descriptor(supports_webhooks: true, supports_backfill: true)

Instance Method Details

#_denormalized_columnsObject



158
159
160
# File 'lib/webhookdb/replicator/fake.rb', line 158

def _denormalized_columns
  return super << Webhookdb::Replicator::Column.new(:extra, TEXT, from_enrichment: true)
end

#_fetch_enrichment(resource, _event, _request) ⇒ Object



166
167
168
169
# File 'lib/webhookdb/replicator/fake.rb', line 166

def _fetch_enrichment(resource, _event, _request)
  r = Webhookdb::Http.get("https://fake-integration/enrichment/" + resource["my_id"], logger: nil, timeout: 30)
  return r.parsed_response
end

#_store_enrichment_body?Boolean

Returns:

  • (Boolean)


162
163
164
# File 'lib/webhookdb/replicator/fake.rb', line 162

def _store_enrichment_body?
  return true
end