Class: InstitutionalProposalObject
- Inherits:
-
Object
- Object
- InstitutionalProposalObject
- Includes:
- DataFactory, DateFactory, Foundry, Navigation, StringFactory
- Defined in:
- lib/kuality-coeus/data_objects/institutional_proposal/institutional_proposal.rb
Instance Attribute Summary collapse
-
#activity_type ⇒ Object
Returns the value of attribute activity_type.
-
#award_id ⇒ Object
Returns the value of attribute award_id.
-
#cost_sharing ⇒ Object
Returns the value of attribute cost_sharing.
-
#custom_data ⇒ Object
Returns the value of attribute custom_data.
-
#dev_proposal_number ⇒ Object
Returns the value of attribute dev_proposal_number.
-
#doc_header ⇒ Object
Returns the value of attribute doc_header.
-
#doc_status ⇒ Object
Returns the value of attribute doc_status.
-
#document_id ⇒ Object
Returns the value of attribute document_id.
-
#initiator ⇒ Object
Returns the value of attribute initiator.
-
#project_personnel ⇒ Object
Returns the value of attribute project_personnel.
-
#project_title ⇒ Object
Returns the value of attribute project_title.
-
#proposal_log ⇒ Object
Returns the value of attribute proposal_log.
-
#proposal_number ⇒ Object
Returns the value of attribute proposal_number.
-
#proposal_status ⇒ Object
Returns the value of attribute proposal_status.
-
#proposal_type ⇒ Object
Returns the value of attribute proposal_type.
-
#special_review ⇒ Object
Returns the value of attribute special_review.
-
#sponsor_id ⇒ Object
Returns the value of attribute sponsor_id.
-
#unrecovered_fa ⇒ Object
Returns the value of attribute unrecovered_fa.
Instance Method Summary collapse
- #add_cost_sharing(opts = {}) ⇒ Object
- #add_custom_data(opts = {}) ⇒ Object
- #add_unrecovered_fa(opts = {}) ⇒ Object
-
#create ⇒ Object
This method is appropriate only in the context of creating an Institutional Proposal from a Proposal Log.
-
#initialize(browser, opts = {}) ⇒ InstitutionalProposalObject
constructor
A new instance of InstitutionalProposalObject.
Methods included from Navigation
#doc_search, #fill_out, #fill_out_item, #on_document?, #on_page?, #open_document, #window_cleanup
Methods included from Utilities
#get, #make_role, #make_user, #random_percentage, #set, #snake_case
Constructor Details
#initialize(browser, opts = {}) ⇒ InstitutionalProposalObject
Returns a new instance of InstitutionalProposalObject.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/kuality-coeus/data_objects/institutional_proposal/institutional_proposal.rb', line 14 def initialize(browser, opts={}) @browser = browser defaults = { proposal_status: 'Pending', activity_type: '::random::', sponsor_id: '::random::', project_personnel: collection('ProjectPersonnel'), special_review: collection('SpecialReview'), cost_sharing: collection('IPCostSharing'), unrecovered_fa: collection('IPUnrecoveredFA') } unless opts[:proposal_log].nil? defaults[:proposal_type]=opts[:proposal_log].proposal_type defaults[:project_title]=opts[:proposal_log].title defaults[:sponsor_id]=opts[:proposal_log].sponsor_id pi = make ProjectPersonnelObject, principal_name: opts[:proposal_log].principal_investigator, role: 'Principal Investigator' defaults[:project_personnel] << pi end (defaults.merge(opts)) end |
Instance Attribute Details
#activity_type ⇒ Object
Returns the value of attribute activity_type.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/institutional_proposal/institutional_proposal.rb', line 9 def activity_type @activity_type end |
#award_id ⇒ Object
Returns the value of attribute award_id.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/institutional_proposal/institutional_proposal.rb', line 9 def award_id @award_id end |
#cost_sharing ⇒ Object
Returns the value of attribute cost_sharing.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/institutional_proposal/institutional_proposal.rb', line 9 def cost_sharing @cost_sharing end |
#custom_data ⇒ Object
Returns the value of attribute custom_data.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/institutional_proposal/institutional_proposal.rb', line 9 def custom_data @custom_data end |
#dev_proposal_number ⇒ Object
Returns the value of attribute dev_proposal_number.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/institutional_proposal/institutional_proposal.rb', line 9 def dev_proposal_number @dev_proposal_number end |
#doc_header ⇒ Object
Returns the value of attribute doc_header.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/institutional_proposal/institutional_proposal.rb', line 9 def doc_header @doc_header end |
#doc_status ⇒ Object
Returns the value of attribute doc_status.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/institutional_proposal/institutional_proposal.rb', line 9 def doc_status @doc_status end |
#document_id ⇒ Object
Returns the value of attribute document_id.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/institutional_proposal/institutional_proposal.rb', line 9 def document_id @document_id end |
#initiator ⇒ Object
Returns the value of attribute initiator.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/institutional_proposal/institutional_proposal.rb', line 9 def initiator @initiator end |
#project_personnel ⇒ Object
Returns the value of attribute project_personnel.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/institutional_proposal/institutional_proposal.rb', line 9 def project_personnel @project_personnel end |
#project_title ⇒ Object
Returns the value of attribute project_title.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/institutional_proposal/institutional_proposal.rb', line 9 def project_title @project_title end |
#proposal_log ⇒ Object
Returns the value of attribute proposal_log.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/institutional_proposal/institutional_proposal.rb', line 9 def proposal_log @proposal_log end |
#proposal_number ⇒ Object
Returns the value of attribute proposal_number.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/institutional_proposal/institutional_proposal.rb', line 9 def proposal_number @proposal_number end |
#proposal_status ⇒ Object
Returns the value of attribute proposal_status.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/institutional_proposal/institutional_proposal.rb', line 9 def proposal_status @proposal_status end |
#proposal_type ⇒ Object
Returns the value of attribute proposal_type.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/institutional_proposal/institutional_proposal.rb', line 9 def proposal_type @proposal_type end |
#special_review ⇒ Object
Returns the value of attribute special_review.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/institutional_proposal/institutional_proposal.rb', line 9 def special_review @special_review end |
#sponsor_id ⇒ Object
Returns the value of attribute sponsor_id.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/institutional_proposal/institutional_proposal.rb', line 9 def sponsor_id @sponsor_id end |
#unrecovered_fa ⇒ Object
Returns the value of attribute unrecovered_fa.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/institutional_proposal/institutional_proposal.rb', line 9 def unrecovered_fa @unrecovered_fa end |
Instance Method Details
#add_cost_sharing(opts = {}) ⇒ Object
61 62 63 |
# File 'lib/kuality-coeus/data_objects/institutional_proposal/institutional_proposal.rb', line 61 def add_cost_sharing opts={} @cost_sharing.add merge_settings(opts) end |
#add_custom_data(opts = {}) ⇒ Object
57 58 59 |
# File 'lib/kuality-coeus/data_objects/institutional_proposal/institutional_proposal.rb', line 57 def add_custom_data opts={} @custom_data = prep(CustomDataObject, opts) end |
#add_unrecovered_fa(opts = {}) ⇒ Object
65 66 67 |
# File 'lib/kuality-coeus/data_objects/institutional_proposal/institutional_proposal.rb', line 65 def add_unrecovered_fa opts={} @unrecovered_fa.add merge_settings(opts) end |
#create ⇒ Object
This method is appropriate only in the context of creating an Institutional Proposal from a Proposal Log.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/kuality-coeus/data_objects/institutional_proposal/institutional_proposal.rb', line 38 def create visit(CentralAdmin).create_institutional_proposal on ProposalLogLookup do |look| look.proposal_number.set @proposal_log.number look.search look.select_item @proposal_log.number end on InstitutionalProposal do |create| @doc_header=create.doc_title @document_id=create.document_id create. @proposal_number=create.institutional_proposal_number create.description.set random_alphanums fill_out create, :proposal_type, :award_id, :activity_type, :project_title set_sponsor_code create.save end end |