Class: Beggar::Base
- Inherits:
-
Object
- Object
- Beggar::Base
- Defined in:
- lib/beggar/base.rb
Instance Attribute Summary collapse
-
#basecamp ⇒ Object
Returns the value of attribute basecamp.
Instance Method Summary collapse
-
#initialize(basecamp) ⇒ Base
constructor
A new instance of Base.
- #progress ⇒ Object
- #salary ⇒ Object
- #summary ⇒ Object
- #worked_hours ⇒ Object
Constructor Details
#initialize(basecamp) ⇒ Base
Returns a new instance of Base.
6 7 8 |
# File 'lib/beggar/base.rb', line 6 def initialize(basecamp) @basecamp = basecamp end |
Instance Attribute Details
#basecamp ⇒ Object
Returns the value of attribute basecamp.
4 5 6 |
# File 'lib/beggar/base.rb', line 4 def basecamp @basecamp end |
Instance Method Details
#progress ⇒ Object
10 11 12 |
# File 'lib/beggar/base.rb', line 10 def progress "#{basecamp.workdays_progression}%" end |
#salary ⇒ Object
18 19 20 |
# File 'lib/beggar/base.rb', line 18 def salary "#{as_money(basecamp.worked_hours)}zł (#{ratio(as_money(basecamp.hours_ratio))}zł)" end |
#summary ⇒ Object
22 23 24 25 26 27 |
# File 'lib/beggar/base.rb', line 22 def summary %Q{Current month Workdays: #{progress} Worked hours: #{worked_hours} Salary: #{salary}} end |
#worked_hours ⇒ Object
14 15 16 |
# File 'lib/beggar/base.rb', line 14 def worked_hours "#{basecamp.worked_hours}h (#{ratio(basecamp.hours_ratio)}h)" end |