-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.rb
executable file
·39 lines (24 loc) · 899 Bytes
/
init.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
require_relative 'app/store_application'
StoreApplication.config do |app|
app.name = 'My Store'
app.environment = :production
app.admin do |admin|
admin.email = '[email protected]'
admin.login = 'admin'
admin.send_info_emails_on :mondays
end
end
@items = []
@items << RealItem.new({:name=>'car', :price=>400000, :weight=>1001 })
@items << RealItem.new({:name=>'car', :price=>424000, :weight=>1400 })
@items << RealItem.new({:name=>'kettle', :price=>20, :weight=>4 })
=begin
cart = Cart.new('Andrey')
cart.add_item RealItem.new({:name=>'car', :price=>400000, :weight=>1001 })
cart.add_item RealItem.new({:name=>'car', :price=>424000, :weight=>1400 })
cart.add_item RealItem.new({:name=>'kettle', :price=>20, :weight=>4 })
=end
order = Order.new
@items.each { |i| order.add_item(i) }
order.place
#order.send_notification_email