class ApiGenerator::Client
Constants
- REST_METHODS
Attributes
rest_method[RW]
url[R]
Public Class Methods
new(url: ApiGenerator::Url.new(""), rest_method: :get)
click to toggle source
# File lib/api_generator/client.rb, line 20 def initialize(url: ApiGenerator::Url.new(""), rest_method: :get) @url = T.let(url, ApiGenerator::Url) @rest_method = T.let(rest_method, Symbol) end
Public Instance Methods
execute(options)
click to toggle source
# File lib/api_generator/client.rb, line 27 def execute(options) Faraday.send(rest_method) do |req| req.params = options req.url = url.url end end
method_missing(method, *args, &block)
click to toggle source
# File lib/api_generator/client.rb, line 35 def method_missing(method, *args, &block) if REST_METHODS.any?(method) return ApiGenerator::Client.new(url: url, rest_method: method) end ApiGenerator::Client.new(url: ApiGenerator::Url.send(url), rest_method: rest_method) end