Class: Forecasting::Models::Role

Inherits:
ForecastRecord show all
Defined in:
lib/forecasting/models/role.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



10
11
12
# File 'lib/forecasting/models/role.rb', line 10

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

#peopleObject



20
21
22
23
24
# File 'lib/forecasting/models/role.rb', line 20

def people
  person_ids.map do |person_id|
    forecast_client.person(id: person_id)
  end
end

#placeholdersObject



14
15
16
17
18
# File 'lib/forecasting/models/role.rb', line 14

def placeholders
  placeholder_ids.map do |placeholder_id|
    forecast_client.placeholder(id: placeholder_id)
  end
end