Completed
Push — master ( 72b331...d4b7d2 )
by Steffen
02:14
created

SoldItem.value()   A

Complexity

Conditions 1

Size

Total Lines 6
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nop 1
1
#!/usr/bin/python
2
# -*- coding: utf-8 -*-
3
4
from time import time
5
6
from kuon.watcher.adapters.models import AbstractEntity
7
8
9
class SoldItem(AbstractEntity):
10
11
    def __init__(self, price: int, wear_value: float, sold_at: int = int(time())):
12
        """Initializing function
13
14
        :param price:
15
        :param wear_value:
16
        :param sold_at:
17
        """
18
        self._price = price
19
        self._wear_value = wear_value
20
        self._sold_at = sold_at
21
22
    @property
23
    def value(self):
24
        return {
25
            'price': self._price,
26
            'wear_value': self._wear_value,
27
            'sold_at': self._sold_at
28
        }
29