Class: TelegraphApi::Client
- Inherits:
-
Object
- Object
- TelegraphApi::Client
- Defined in:
- lib/telegraph_api_ruby/client.rb
Constant Summary collapse
- API_URL =
'https://api.telegra.ph/'.freeze
- REQUEST_RESPONSE =
{ create_account: Types::Account, edit_account_info: Types::Account, get_account_info: Types::Account, revoke_access_token: Types::Account, create_page: Types::Page, edit_page: Types::Page, get_page: Types::Page, get_page_list: Types::PageList, get_views: Types::PageViews }.freeze
Class Method Summary collapse
- .method_missing(method, *args, &block) ⇒ Object
- .respond_to_missing?(method, include_all = false) ⇒ Boolean
Class Method Details
.method_missing(method, *args, &block) ⇒ Object
21 22 23 24 |
# File 'lib/telegraph_api_ruby/client.rb', line 21 def self.method_missing(method, *args, &block) path = ActiveSupport::Inflector.camelize(method.to_s, false) Request.call(path, *args, REQUEST_RESPONSE[method.to_sym]) end |
.respond_to_missing?(method, include_all = false) ⇒ Boolean
26 27 28 |
# File 'lib/telegraph_api_ruby/client.rb', line 26 def self.respond_to_missing?(method, include_all = false) REQUEST_RESPONSE[method.to_sym] || super end |