Class: RailsPlan::Cli::FetchTemplate

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_plan/cli/fetch_template.rb

Constant Summary collapse

API_HOST =
'https://railsplan.com'

Instance Method Summary collapse

Instance Method Details

#call(uid) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/rails_plan/cli/fetch_template.rb', line 8

def call(uid)
  api_url = ENV.fetch('API_HOST', API_HOST)
  response = RestClient.get(api_url + "/api/v1/plans/#{uid}") { |res| res }

  return if response.code != 200

  JSON.parse(response.body)
end