Module: Namabar
- Defined in:
- lib/namabar.rb,
lib/namabar/client.rb,
lib/namabar/version.rb,
lib/namabar/endpoints.rb,
lib/namabar/configuration.rb
Overview
The main Namabar module providing convenient access to the Namabar API
This module serves as the primary entry point for the Namabar gem, offering:
-
Global configuration management
-
Client creation and management
-
Error handling for the entire gem
Defined Under Namespace
Modules: Endpoints Classes: Client, Configuration, Error
Constant Summary collapse
- VERSION =
The current version of the Namabar gem
This constant follows semantic versioning (SemVer) conventions:
-
MAJOR: Incompatible API changes
-
MINOR: Backwards-compatible functionality additions
-
PATCH: Backwards-compatible bug fixes
-
'0.1.0'
Class Attribute Summary collapse
-
.configuration ⇒ Configuration?
The global configuration instance.
Class Method Summary collapse
-
.client(*args) ⇒ Client
Create a new Namabar API client.
-
.configure {|config| ... } ⇒ Configuration
Configure the Namabar gem with API credentials and settings.
Class Attribute Details
.configuration ⇒ Configuration?
Returns the global configuration instance.
41 42 43 |
# File 'lib/namabar.rb', line 41 def configuration @configuration end |
Class Method Details
.client(*args) ⇒ Client
Create a new Namabar API client
Creates and returns a new Client instance using the global configuration. This is a convenience method equivalent to calling Client.new directly.
79 80 81 |
# File 'lib/namabar.rb', line 79 def self.client(*args) Client.new(*args) end |
.configure {|config| ... } ⇒ Configuration
Configure the Namabar gem with API credentials and settings
This method provides a convenient way to set up the global configuration that will be used by all Client instances. The configuration object is yielded to the provided block for modification.
60 61 62 63 64 |
# File 'lib/namabar.rb', line 60 def self.configure self.configuration ||= Configuration.new yield(configuration) configuration end |