Class: Forecast::API::Projects

Inherits:
Base
  • Object
show all
Includes:
Behavior::Crud
Defined in:
lib/forecast/api/projects.rb

Instance Attribute Summary

Attributes inherited from Base

#credentials

Instance Method Summary collapse

Methods included from Behavior::Crud

#all, #find

Methods inherited from Base

api_model, #initialize

Constructor Details

This class inherits a constructor from Forecast::API::Base

Instance Method Details

#createObject



18
# File 'lib/forecast/api/projects.rb', line 18

def create ; raise "not implemented" ; end

#deleteObject



20
# File 'lib/forecast/api/projects.rb', line 20

def delete ; raise "not implemented" ; end

#find_by_harvest_id(harvest_project_id) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/forecast/api/projects.rb', line 8

def find_by_harvest_id(harvest_project_id)
  selected = self.all.select{|x| x.harvest_id == harvest_project_id}

  if selected.size > 1
    raise "Forecasted::Error - more than 1 harvest_id forecast project"
  else
    return selected.first
  end
end

#updateObject



19
# File 'lib/forecast/api/projects.rb', line 19

def update ; raise "not implemented" ; end