Class: ClientsController

Inherits:
Object
  • Object
show all
Defined in:
lib/invoices/controllers/clients_controller.rb

Instance Method Summary collapse

Constructor Details

#initializeClientsController

Returns a new instance of ClientsController.



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/invoices/controllers/clients_controller.rb', line 2

def initialize
  client = Client.new
  puts "client name >"
  client.name = $stdin.gets.chomp
  puts "street1 >"
  client.street1 = $stdin.gets.chomp
  puts "street2 >"
  client.street2 = $stdin.gets.chomp
  puts "city >"
  client.city = $stdin.gets.chomp
  puts "state (2 letters) >"
  client.state = $stdin.gets.chomp
  puts "zip (5 digits) >"
  client.zip = $stdin.gets.chomp
  puts "phone >"
  client.phone = $stdin.gets.chomp
  puts "email >"
  client.email = $stdin.gets.chomp
  puts "hourly rate you'll charge this client >"
  client.rate = $stdin.gets.chomp
  client.save
end