23 lines
633 B
Python
23 lines
633 B
Python
|
class Server:
|
||
|
def __init__(self, key, name, cpu, ram, price, hdd, next_reduce, datacenter, freetext):
|
||
|
self.key = key
|
||
|
self.name = name
|
||
|
self.cpu = cpu
|
||
|
self.ram = ram
|
||
|
self.price = float(price)
|
||
|
self.hdd = hdd
|
||
|
self.next_reduce = next_reduce
|
||
|
self.datacenter = datacenter
|
||
|
self.freetext = freetext
|
||
|
|
||
|
@property
|
||
|
def price_per_cpu(self):
|
||
|
return self.price / self.cpu.benchmark
|
||
|
|
||
|
@property
|
||
|
def price_per_ram(self):
|
||
|
return self.price / self.ram
|
||
|
|
||
|
@property
|
||
|
def price_per_hdd(self):
|
||
|
return self.price / self.hdd.total_size
|