Class: Forecasting::Models::RemainingBudgetedHours

Inherits:
Base
  • Object
show all
Defined in:
lib/forecasting/models/remaining_budgeted_hours.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#attributes

Instance Method Summary collapse

Methods inherited from Base

attributed, modeled, #to_hash

Constructor Details

#initialize(attrs, opts = {}) ⇒ RemainingBudgetedHours

Returns a new instance of RemainingBudgetedHours.



13
14
15
16
# File 'lib/forecasting/models/remaining_budgeted_hours.rb', line 13

def initialize(attrs, opts = {})
  @forecast_client = opts[:forecast_client] || Forecasting::Client.new(**opts)
  super(attrs)
end

Instance Attribute Details

#forecast_clientForecasting::Model::Client (readonly)

Returns:

  • (Forecasting::Model::Client)


5
6
7
# File 'lib/forecasting/models/remaining_budgeted_hours.rb', line 5

def forecast_client
  @forecast_client
end

Instance Method Details

#projectObject



18
19
20
# File 'lib/forecasting/models/remaining_budgeted_hours.rb', line 18

def project
  forecast_client.project(id: project_id)
end