Class: StudyplusForSchoolSync::Cli

Inherits:
Thor
  • Object
show all
Defined in:
lib/studyplus_for_school_sync/cli.rb

Overview

Command Line Tool

Constant Summary collapse

DEFAULT_REDIRECT_URI =
"https://localhost:8080"

Instance Method Summary collapse

Instance Method Details

#authorize(base_url, client_id) ⇒ Object


19
20
21
22
23
24
# File 'lib/studyplus_for_school_sync/cli.rb', line 19

def authorize(base_url, client_id)
  params = { client_id: client_id, base_url: base_url, redirect_uri: DEFAULT_REDIRECT_URI }
  params[:redirect_uri] = options[:redirect_uri] if options[:redirect_uri]
  params[:scopes] = options[:scopes].split(",") if options[:scopes]
  StudyplusForSchoolSync::Authorizer.new(**params).authorize
end

#serverObject


10
11
12
13
14
# File 'lib/studyplus_for_school_sync/cli.rb', line 10

def server
  params = {}
  params[:port] = options[:port] if options[:port]
  StudyplusForSchoolSync::Server.new.start(**params)
end