Class: RailsPlan::Cli::FetchTemplate

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

Constant Summary collapse

API_URL =

API_URL = ‘railsplan.com/api/v1

'http://localhost:3000/api/v1'

Instance Method Summary collapse

Instance Method Details

#call(uid) ⇒ Object



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

def call(uid)
  response = RestClient.get(API_URL + "/plans/#{uid}") { |res| res }

  return if response.code != 200

  JSON.parse(response.body)
end