Class: IPCostSharingObject
- Inherits:
-
Object
- Object
- IPCostSharingObject
- Includes:
- DataFactory, Foundry, Navigation, StringFactory
- Defined in:
- lib/kuality-coeus/data_objects/institutional_proposal/ip_cost_sharing.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#index ⇒ Object
Returns the value of attribute index.
-
#percentage ⇒ Object
Returns the value of attribute percentage.
-
#project_period ⇒ Object
Returns the value of attribute project_period.
-
#source_account ⇒ Object
Returns the value of attribute source_account.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #create ⇒ Object
- #edit(opts) ⇒ Object
-
#initialize(browser, opts = {}) ⇒ IPCostSharingObject
constructor
A new instance of IPCostSharingObject.
- #view ⇒ Object
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 = {}) ⇒ IPCostSharingObject
Returns a new instance of IPCostSharingObject.
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/kuality-coeus/data_objects/institutional_proposal/ip_cost_sharing.rb', line 11 def initialize(browser, opts={}) @browser = browser defaults = { project_period: '1', percentage: '100.00', type: '::random::', source_account: random_alphanums, amount: random_dollar_value(1000) } (defaults.merge(opts)) end |
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
8 9 10 |
# File 'lib/kuality-coeus/data_objects/institutional_proposal/ip_cost_sharing.rb', line 8 def amount @amount end |
#index ⇒ Object
Returns the value of attribute index.
8 9 10 |
# File 'lib/kuality-coeus/data_objects/institutional_proposal/ip_cost_sharing.rb', line 8 def index @index end |
#percentage ⇒ Object
Returns the value of attribute percentage.
8 9 10 |
# File 'lib/kuality-coeus/data_objects/institutional_proposal/ip_cost_sharing.rb', line 8 def percentage @percentage end |
#project_period ⇒ Object
Returns the value of attribute project_period.
8 9 10 |
# File 'lib/kuality-coeus/data_objects/institutional_proposal/ip_cost_sharing.rb', line 8 def project_period @project_period end |
#source_account ⇒ Object
Returns the value of attribute source_account.
8 9 10 |
# File 'lib/kuality-coeus/data_objects/institutional_proposal/ip_cost_sharing.rb', line 8 def source_account @source_account end |
#type ⇒ Object
Returns the value of attribute type.
8 9 10 |
# File 'lib/kuality-coeus/data_objects/institutional_proposal/ip_cost_sharing.rb', line 8 def type @type end |
Instance Method Details
#create ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/kuality-coeus/data_objects/institutional_proposal/ip_cost_sharing.rb', line 24 def create view on Distribution do |page| page. page.add_cost_share_project_period.set @project_period page.add_cost_share_type.pick! @type page.add_cost_share_percentage.set @percentage page.add_cost_share_source_account.set @source_account page.add_cost_share_amount.set @amount page.add_cost_share end end |
#edit(opts) ⇒ Object
43 44 45 46 47 48 49 50 51 |
# File 'lib/kuality-coeus/data_objects/institutional_proposal/ip_cost_sharing.rb', line 43 def edit(opts) view on Distribution do |page| page. #TODO: Add this code page.save end (opts) end |
#view ⇒ Object
37 38 39 40 41 |
# File 'lib/kuality-coeus/data_objects/institutional_proposal/ip_cost_sharing.rb', line 37 def view # Note: Currently assumes we're already viewing # the institutional proposal! on(InstitutionalProposal).distribution end |