Class: Beggar::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/beggar/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#basecampObject

Returns the value of attribute basecamp.



4
5
6
# File 'lib/beggar/base.rb', line 4

def basecamp
  @basecamp
end

Instance Method Details

#progressObject



10
11
12
# File 'lib/beggar/base.rb', line 10

def progress
  "#{basecamp.workdays_progression}%"
end

#salaryObject



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

#summaryObject



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_hoursObject



14
15
16
# File 'lib/beggar/base.rb', line 14

def worked_hours
  "#{basecamp.worked_hours}h (#{ratio(basecamp.hours_ratio)}h)"
end