Class: Teller::Client
- Inherits:
-
Object
- Object
- Teller::Client
- Defined in:
- lib/teller/client.rb
Constant Summary collapse
- URL =
"https://api.teller.io".freeze
Instance Method Summary collapse
-
#initialize(overrides = {}) ⇒ Client
constructor
A new instance of Client.
- #method_missing(method, *args, &block) ⇒ Object
- #respond_to_missing?(method, include_private = false) ⇒ Boolean
Constructor Details
#initialize(overrides = {}) ⇒ Client
Returns a new instance of Client.
5 6 7 8 9 10 11 12 |
# File 'lib/teller/client.rb', line 5 def initialize(overrides={}) config = Teller::Config.dup config.setup(overrides) client = Teller::API.new(config) entrypoint = client.get(URL) @target = Teller::Resource.new(entrypoint, client) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/teller/client.rb', line 14 def method_missing(method, *args, &block) if @target.respond_to?(method) @target.send(method, *args, &block) else super end end |
Instance Method Details
#respond_to_missing?(method, include_private = false) ⇒ Boolean
22 23 24 |
# File 'lib/teller/client.rb', line 22 def respond_to_missing?(method, include_private = false) @target.respond_to?(method) end |