Class: MOCO::ReportsProxy
- Inherits:
-
Object
- Object
- MOCO::ReportsProxy
- Defined in:
- lib/moco/client.rb
Overview
Proxy for accessing report endpoints
Instance Method Summary collapse
-
#absences(year: nil, active: nil) ⇒ Object
Get absences report.
-
#cashflow(from: nil, to: nil, term: nil) ⇒ Object
Get cashflow report.
-
#finance(from: nil, to: nil, term: nil) ⇒ Object
Get finance report.
-
#initialize(client) ⇒ ReportsProxy
constructor
A new instance of ReportsProxy.
-
#utilization(from:, to:) ⇒ Object
Get utilization report.
Constructor Details
#initialize(client) ⇒ ReportsProxy
Returns a new instance of ReportsProxy.
67 68 69 |
# File 'lib/moco/client.rb', line 67 def initialize(client) @client = client end |
Instance Method Details
#absences(year: nil, active: nil) ⇒ Object
Get absences report
74 75 76 77 78 79 |
# File 'lib/moco/client.rb', line 74 def absences(year: nil, active: nil) params = {} params[:year] = year if year params[:active] = active unless active.nil? @client.get("report/absences", params) end |
#cashflow(from: nil, to: nil, term: nil) ⇒ Object
Get cashflow report
85 86 87 88 89 90 91 |
# File 'lib/moco/client.rb', line 85 def cashflow(from: nil, to: nil, term: nil) params = {} params[:from] = from if from params[:to] = to if to params[:term] = term if term @client.get("report/cashflow", params) end |
#finance(from: nil, to: nil, term: nil) ⇒ Object
Get finance report
97 98 99 100 101 102 103 |
# File 'lib/moco/client.rb', line 97 def finance(from: nil, to: nil, term: nil) params = {} params[:from] = from if from params[:to] = to if to params[:term] = term if term @client.get("report/finance", params) end |
#utilization(from:, to:) ⇒ Object
Get utilization report
108 109 110 |
# File 'lib/moco/client.rb', line 108 def utilization(from:, to:) @client.get("report/utilization", { from:, to: }) end |