Class: Ralph::CLI::Commands::Base
- Inherits:
-
Hanami::CLI::Command
- Object
- Hanami::CLI::Command
- Ralph::CLI::Commands::Base
- Defined in:
- lib/ralph/cli/commands/base.rb
Instance Method Summary collapse
Instance Method Details
#gen_client ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/ralph/cli/commands/base.rb', line 6 def gen_client api_url = ENV['RALPH_URL'] token = ENV['RALPH_TOKEN'] Faraday.new(api_url) do |conn| conn.request :json conn.response :json, content_type: /\bjson$/ conn.adapter Faraday.default_adapter if token conn. :Token, token end end end |