Class: SpecialReviewObject

Inherits:
Object
  • Object
show all
Includes:
DataFactory, Foundry, Navigation, StringFactory
Defined in:
lib/kuality-coeus/data_objects/proposal_development/special_review.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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 = {}) ⇒ SpecialReviewObject

Returns a new instance of SpecialReviewObject.



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/kuality-coeus/data_objects/proposal_development/special_review.rb', line 12

def initialize(browser, opts={})
  @browser = browser

  defaults = {
    type:            '::random::',
    approval_status: '::random::'
  }

  set_options(defaults.merge(opts))
  requires :document_id, :doc_type
end

Instance Attribute Details

#application_dateObject

Returns the value of attribute application_date.



8
9
10
# File 'lib/kuality-coeus/data_objects/proposal_development/special_review.rb', line 8

def application_date
  @application_date
end

#approval_dateObject

Returns the value of attribute approval_date.



8
9
10
# File 'lib/kuality-coeus/data_objects/proposal_development/special_review.rb', line 8

def approval_date
  @approval_date
end

#approval_statusObject

Returns the value of attribute approval_status.



8
9
10
# File 'lib/kuality-coeus/data_objects/proposal_development/special_review.rb', line 8

def approval_status
  @approval_status
end

#doc_typeObject

Returns the value of attribute doc_type.



8
9
10
# File 'lib/kuality-coeus/data_objects/proposal_development/special_review.rb', line 8

def doc_type
  @doc_type
end

#document_idObject

Returns the value of attribute document_id.



8
9
10
# File 'lib/kuality-coeus/data_objects/proposal_development/special_review.rb', line 8

def document_id
  @document_id
end

#exemption_numberObject

Returns the value of attribute exemption_number.



8
9
10
# File 'lib/kuality-coeus/data_objects/proposal_development/special_review.rb', line 8

def exemption_number
  @exemption_number
end

#expiration_dateObject

Returns the value of attribute expiration_date.



8
9
10
# File 'lib/kuality-coeus/data_objects/proposal_development/special_review.rb', line 8

def expiration_date
  @expiration_date
end

#protocol_numberObject

Returns the value of attribute protocol_number.



8
9
10
# File 'lib/kuality-coeus/data_objects/proposal_development/special_review.rb', line 8

def protocol_number
  @protocol_number
end

#typeObject

Returns the value of attribute type.



8
9
10
# File 'lib/kuality-coeus/data_objects/proposal_development/special_review.rb', line 8

def type
  @type
end

Instance Method Details

#createObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/kuality-coeus/data_objects/proposal_development/special_review.rb', line 24

def create
  navigate
  on SpecialReview do |add|
    add.add_type.pick! @type
    case(@type)
      when 'Human Subjects'
        @approval_status='Pending/In Progress'
      else
        add.add_approval_status.pick! @approval_status
    end
    add.add_protocol_number.fit @protocol_number
    add.add_application_date.fit @application_date
    add.add_approval_date.fit @approval_date
    add.add_expiration_date.fit @expiration_date
    add.add_exemption_number.fit @exemption_number
    add.add
    break if add.error_messages_div.present? # No need to save if we've thrown an error already
    add.save
  end
end

#edit(opts = {}) ⇒ Object



45
46
47
48
# File 'lib/kuality-coeus/data_objects/proposal_development/special_review.rb', line 45

def edit opts={}
  # TODO
  set_options(opts)
end