Module call :: Class Call
[hide private]
[frames] | no frames]

Class Call

source code

object --+
         |
        Call

The class Call represents billing information of phone calls. Each phone call is defined by its duration, its price per minute, and the price to start the call. A phone call object's state is immutable once the object has been created.

The class's methods automatically take into account the network usage component of a phone calls (paikallisverkkomaksu). These are assumed to be constants irrespective of location.

Instance Methods [hide private]
 
__init__(self, start_price, minute_price, duration)
Creates a new phone call object with the given attributes.
source code
 
is_more_expensive_than(self, another_call)
Determines if the phone call has a higher total cost than another given phone call.
source code
 
get_price(self)
Returns the full price of the phone call, including network usage costs (paikallisverkkomaksu).
source code
 
get_description(self)
Returns a string description of the phone call, detailing the duration and price of the call.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  NETWORK_START_COST = 0.0099
  NETWORK_MINUTE_COST = 0.0199
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, start_price, minute_price, duration)
(Constructor)

source code 

Creates a new phone call object with the given attributes.

Parameters:
  • start_price - the start price of the phone call in euros, not including network usage fees
  • minute_price - the price per minute of the phone call in euros, not including network usage fees
  • duration - the length of the phone call, in minutes
Overrides: object.__init__

is_more_expensive_than(self, another_call)

source code 

Determines if the phone call has a higher total cost than another given phone call.

Parameters:
  • another_call - a phone call to compare this one to
Returns:
a boolean value indicating if this call was more expensive than the given one

get_price(self)

source code 

Returns the full price of the phone call, including network usage costs (paikallisverkkomaksu).

Returns:
full price of call

get_description(self)

source code 

Returns a string description of the phone call, detailing the duration and price of the call.

Returns:
a string description of the call