Class: AwardObject
- Inherits:
-
Object
- Object
- AwardObject
- Includes:
- DataFactory, DateFactory, Foundry, Navigation, StringFactory
- Defined in:
- lib/kuality-coeus/data_objects/award/award.rb
Instance Attribute Summary collapse
-
#activity_type ⇒ Object
Returns the value of attribute activity_type.
-
#anticipated_amount ⇒ Object
Returns the value of attribute anticipated_amount.
-
#award_id ⇒ Object
Returns the value of attribute award_id.
-
#award_status ⇒ Object
Returns the value of attribute award_status.
-
#award_title ⇒ Object
Returns the value of attribute award_title.
-
#award_type ⇒ Object
Returns the value of attribute award_type.
-
#creation_date ⇒ Object
Returns the value of attribute creation_date.
-
#description ⇒ Object
Returns the value of attribute description.
-
#document_id ⇒ Object
Returns the value of attribute document_id.
-
#funding_proposal ⇒ Object
Returns the value of attribute funding_proposal.
-
#lead_unit ⇒ Object
Returns the value of attribute lead_unit.
-
#obligated_amount ⇒ Object
Returns the value of attribute obligated_amount.
-
#obligation_end_date ⇒ Object
Returns the value of attribute obligation_end_date.
-
#obligation_start_date ⇒ Object
Returns the value of attribute obligation_start_date.
-
#project_end_date ⇒ Object
Returns the value of attribute project_end_date.
-
#project_start_date ⇒ Object
Returns the value of attribute project_start_date.
-
#sponsor_id ⇒ Object
Returns the value of attribute sponsor_id.
-
#transaction_type ⇒ Object
Returns the value of attribute transaction_type.
-
#transactions ⇒ Object
Returns the value of attribute transactions.
Instance Method Summary collapse
-
#add_funding_proposal ⇒ Object
TODO: Add support for multiple funding proposals and merge types.
- #add_transaction(opts = {}) ⇒ Object
- #create ⇒ Object
-
#initialize(browser, opts = {}) ⇒ AwardObject
constructor
A new instance of AwardObject.
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 = {}) ⇒ AwardObject
Returns a new instance of AwardObject.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/kuality-coeus/data_objects/award/award.rb', line 15 def initialize(browser, opts={}) @browser = browser defaults = { description: random_alphanums, transaction_type: '::random::', award_status: '::random::', award_title: random_alphanums, activity_type: '::random::', award_type: '::random::', project_start_date: right_now[:date_w_slashes], project_end_date: in_a_year[:date_w_slashes], sponsor_id: '::random::', lead_unit: '::random::', obligation_start_date: right_now[:date_w_slashes], obligation_end_date: in_a_year[:date_w_slashes], anticipated_amount: '1000000', obligated_amount: '1000000', transactions: collection('Transaction') } (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/award/award.rb', line 9 def activity_type @activity_type end |
#anticipated_amount ⇒ Object
Returns the value of attribute anticipated_amount.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/award/award.rb', line 9 def anticipated_amount @anticipated_amount end |
#award_id ⇒ Object
Returns the value of attribute award_id.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/award/award.rb', line 9 def award_id @award_id end |
#award_status ⇒ Object
Returns the value of attribute award_status.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/award/award.rb', line 9 def award_status @award_status end |
#award_title ⇒ Object
Returns the value of attribute award_title.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/award/award.rb', line 9 def award_title @award_title end |
#award_type ⇒ Object
Returns the value of attribute award_type.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/award/award.rb', line 9 def award_type @award_type end |
#creation_date ⇒ Object
Returns the value of attribute creation_date.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/award/award.rb', line 9 def creation_date @creation_date end |
#description ⇒ Object
Returns the value of attribute description.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/award/award.rb', line 9 def description @description end |
#document_id ⇒ Object
Returns the value of attribute document_id.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/award/award.rb', line 9 def document_id @document_id end |
#funding_proposal ⇒ Object
Returns the value of attribute funding_proposal.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/award/award.rb', line 9 def funding_proposal @funding_proposal end |
#lead_unit ⇒ Object
Returns the value of attribute lead_unit.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/award/award.rb', line 9 def lead_unit @lead_unit end |
#obligated_amount ⇒ Object
Returns the value of attribute obligated_amount.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/award/award.rb', line 9 def obligated_amount @obligated_amount end |
#obligation_end_date ⇒ Object
Returns the value of attribute obligation_end_date.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/award/award.rb', line 9 def obligation_end_date @obligation_end_date end |
#obligation_start_date ⇒ Object
Returns the value of attribute obligation_start_date.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/award/award.rb', line 9 def obligation_start_date @obligation_start_date end |
#project_end_date ⇒ Object
Returns the value of attribute project_end_date.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/award/award.rb', line 9 def project_end_date @project_end_date end |
#project_start_date ⇒ Object
Returns the value of attribute project_start_date.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/award/award.rb', line 9 def project_start_date @project_start_date end |
#sponsor_id ⇒ Object
Returns the value of attribute sponsor_id.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/award/award.rb', line 9 def sponsor_id @sponsor_id end |
#transaction_type ⇒ Object
Returns the value of attribute transaction_type.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/award/award.rb', line 9 def transaction_type @transaction_type end |
#transactions ⇒ Object
Returns the value of attribute transactions.
9 10 11 |
# File 'lib/kuality-coeus/data_objects/award/award.rb', line 9 def transactions @transactions end |
Instance Method Details
#add_funding_proposal ⇒ Object
TODO: Add support for multiple funding proposals and merge types.
57 58 59 60 61 62 63 |
# File 'lib/kuality-coeus/data_objects/award/award.rb', line 57 def add_funding_proposal # TODO: Add support for multiple funding proposals and merge types. on Award do |page| page. page.institutional_proposal_number.set @funding_proposal page.add_proposal end end |
#add_transaction(opts = {}) ⇒ Object
65 66 67 68 |
# File 'lib/kuality-coeus/data_objects/award/award.rb', line 65 def add_transaction opts={} defaults={award_id: @award_id} @transactions.add defaults.merge(opts) end |
#create ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/kuality-coeus/data_objects/award/award.rb', line 39 def create @creation_date = right_now[:date_w_slashes] visit(CentralAdmin).create_award on Award do |create| create. fill_out create, :description, :transaction_type, :award_status, :award_title, :activity_type, :award_type, :obligated_amount, :anticipated_amount, :project_start_date, :project_end_date, :obligation_start_date, :obligation_end_date set_sponsor_id set_lead_unit create.save @document_id = create.header_document_id @award_id = create.header_award_id end add_funding_proposal if @funding_proposal end |