Class: CodaDocs::Client
- Inherits:
-
Object
- Object
- CodaDocs::Client
- Defined in:
- lib/coda_docs/client.rb
Instance Method Summary collapse
-
#initialize(access_token = nil) ⇒ Client
constructor
A new instance of Client.
- #method_missing(method_name, *args, &block) ⇒ Object
Constructor Details
#initialize(access_token = nil) ⇒ Client
Returns a new instance of Client.
8 9 10 |
# File 'lib/coda_docs/client.rb', line 8 def initialize(access_token = nil) @access_token = access_token || ENV['CODA_DOCS_API_KEY'] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/coda_docs/client.rb', line 12 def method_missing(method_name, *args, &block) klass = "CodaDocs::Entities::#{method_name.to_s.capitalize}" .constantize if klass klass.new(access_token) end end |