Class: Maker::Commands::Register

Inherits:
Object
  • Object
show all
Defined in:
lib/maker/commands/register.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args, options) ⇒ Register

Returns a new instance of Register.



6
7
8
9
# File 'lib/maker/commands/register.rb', line 6

def initialize(args, options)
  @email = args.first
  run
end

Instance Attribute Details

#emailObject (readonly)

Returns the value of attribute email.



4
5
6
# File 'lib/maker/commands/register.rb', line 4

def email
  @email
end

Instance Method Details

#clientObject



21
22
23
# File 'lib/maker/commands/register.rb', line 21

def client
  @client ||= Client.new
end

#runObject



11
12
13
14
15
# File 'lib/maker/commands/register.rb', line 11

def run
  student = server.student

  client.save(student)
end

#serverObject



17
18
19
# File 'lib/maker/commands/register.rb', line 17

def server
  @server ||= Server.new(email)
end