Class: Learn::Student

Inherits:
Object
  • Object
show all
Defined in:
lib/learn/student.rb

Class Method Summary collapse

Class Method Details

.register(account_number) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/learn/student.rb', line 5

def self.register()
    begin
        response = RestClient.post(
            "#{Learn::HOST}/students",
            JSON.dump(student: {account_number: }),
            content_type: :json
        )
        Learn.write_settings(response)
    rescue Exception => e
        puts "Couldn't register because of #{e}"
    end
end