Class: Forecasting::Models::Assignment

Inherits:
ForecastRecord show all
Defined in:
lib/forecasting/models/assignment.rb

Instance Attribute Summary

Attributes inherited from Base

#attributes, #forecast_client

Instance Method Summary collapse

Methods inherited from ForecastRecord

#create, #delete, #fetch, get, #save, #type, #update

Methods inherited from Base

attributed, #initialize, modeled, #to_hash

Constructor Details

This class inherits a constructor from Forecasting::Models::Base

Instance Method Details

#pathObject



17
18
19
# File 'lib/forecasting/models/assignment.rb', line 17

def path
  @attributes['id'].nil? ? "assignments" : "assignments/#{@attributes['id']}"
end

#personObject



25
26
27
# File 'lib/forecasting/models/assignment.rb', line 25

def person
  forecast_client.person(id: person_id)
end

#placeholderObject



29
30
31
# File 'lib/forecasting/models/assignment.rb', line 29

def placeholder
  forecast_client.placeholder(id: placeholder_id)
end

#projectObject



21
22
23
# File 'lib/forecasting/models/assignment.rb', line 21

def project
  forecast_client.project(id: project_id)
end