Module: Pokeedex
- Defined in:
- lib/pokeedex.rb,
lib/pokeedex/version.rb,
lib/pokeedex/database.rb,
lib/pokeedex/exceptions.rb,
lib/pokeedex/pokemon/base.rb,
lib/pokeedex/configuration.rb,
lib/pokeedex/install_playwright.rb,
lib/pokeedex/pokemon/model/base.rb,
lib/pokeedex/pokemon/scrapper/base.rb,
lib/pokeedex/pokemon/searcher/base.rb,
lib/pokeedex/pokemon/decorators/base.rb,
lib/pokeedex/pokemon/scrapper/pokedex.rb,
lib/pokeedex/pokemon/scrapper/parsers/base.rb,
lib/pokeedex/pokemon/scrapper/fetchers/base.rb
Overview
:nodoc:
Defined Under Namespace
Modules: Exceptions, Pokemon Classes: Configuration, Database, InstallPlaywright
Constant Summary collapse
- VERSION =
'0.1.5'
Class Attribute Summary collapse
-
.root_path ⇒ Object
readonly
Return the root path of the gem.
Class Method Summary collapse
-
.configuration ⇒ Object
The configuration of the gem.
-
.configure {|configuration| ... } ⇒ Object
Configure the gem with a block of configuration.
-
.connect_to_database ⇒ Object
Connect to the database and run the migrations.
-
.init ⇒ Object
Init the gem by connecting to the database and running the migrations if needed and loading the models.
Class Attribute Details
.root_path ⇒ Object (readonly)
Return the root path of the gem
Example
> Pokeedex.root_path
> "/path/to/pokeedex"
27 28 29 |
# File 'lib/pokeedex.rb', line 27 def root_path @root_path end |
Class Method Details
.configuration ⇒ Object
The configuration of the gem
32 33 34 |
# File 'lib/pokeedex.rb', line 32 def self.configuration @configuration ||= Configuration.new end |
.configure {|configuration| ... } ⇒ Object
Configure the gem with a block of configuration
38 39 40 |
# File 'lib/pokeedex.rb', line 38 def self.configure yield(configuration) end |
.connect_to_database ⇒ Object
Connect to the database and run the migrations
44 45 46 47 48 49 |
# File 'lib/pokeedex.rb', line 44 def self.connect_to_database Database.connect(configuration) Database.run_migrations! require_relative 'pokeedex/pokemon/model/base' end |
.init ⇒ Object
Init the gem by connecting to the database and running the migrations if needed and loading the models
53 54 55 56 57 |
# File 'lib/pokeedex.rb', line 53 def self.init InstallPlaywright.run! connect_to_database end |