Module: Fal
- Defined in:
- lib/fal.rb,
lib/fal/model.rb,
lib/fal/price.rb,
lib/fal/client.rb,
lib/fal/stream.rb,
lib/fal/request.rb,
lib/fal/version.rb,
lib/fal/price_estimate.rb,
lib/fal/webhook_request.rb
Defined Under Namespace
Classes: Client, Configuration, ConfigurationError, Error, ForbiddenError, Model, NotFoundError, Price, PriceEstimate, Request, ServerError, Stream, UnauthorizedError, WebhookRequest
Constant Summary collapse
- VERSION =
"0.1.0"
Class Attribute Summary collapse
-
.configuration ⇒ Fal::Configuration
The global configuration instance.
Class Method Summary collapse
-
.client ⇒ Fal::Client
Global client accessor using the configured settings.
-
.configure {|Fal::Configuration| ... } ⇒ void
Configure the fal client.
-
.deep_symbolize_keys(obj) ⇒ Hash, Array
Deep symbolize keys of a Hash or Array.
Class Attribute Details
.configuration ⇒ Fal::Configuration
The global configuration instance.
67 68 69 |
# File 'lib/fal.rb', line 67 def configuration @configuration end |
Class Method Details
.client ⇒ Fal::Client
Global client accessor using the configured settings.
79 80 81 82 |
# File 'lib/fal.rb', line 79 def client configuration = self.configuration || Configuration.new @client ||= Fal::Client.new(configuration) end |
.configure {|Fal::Configuration| ... } ⇒ void
This method returns an undefined value.
Configure the fal client.
72 73 74 75 |
# File 'lib/fal.rb', line 72 def configure self.configuration ||= Configuration.new yield(configuration) end |
.deep_symbolize_keys(obj) ⇒ Hash, Array
Deep symbolize keys of a Hash or Array.
87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/fal.rb', line 87 def deep_symbolize_keys(obj) case obj when Hash obj.each_with_object({}) do |(k, v), result| key = k.is_a?(String) ? k.to_sym : k result[key] = deep_symbolize_keys(v) end when Array obj.map { |e| deep_symbolize_keys(e) } else obj end end |