Class: Fetcher::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/bas/fetcher/base.rb

Overview

The Fetcher::Base class serves as the foundation for implementing specific data fetchers within the Fetcher module. Operating as an interface, this class defines essential attributes and methods, providing a blueprint for creating custom fetchers tailored to different data sources.

Direct Known Subclasses

Imap::Base, Notion::Base, Postgres::Base

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Base

Initializes the fetcher with essential configuration parameters.



16
17
18
# File 'lib/bas/fetcher/base.rb', line 16

def initialize(config)
  @config = config
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



12
13
14
# File 'lib/bas/fetcher/base.rb', line 12

def config
  @config
end

Instance Method Details

#fetchObject

A method meant to fetch data from an specific source depending on the implementation. Must be overridden by subclasses, with specific logic based on the use case.


raises Domain::Exceptions::FunctionNotImplemented when missing implementation.



26
27
28
# File 'lib/bas/fetcher/base.rb', line 26

def fetch
  raise Domain::Exceptions::FunctionNotImplemented
end