Class: PersonnelAttachmentObject

Inherits:
Object
  • Object
show all
Includes:
DataFactory, Foundry, Navigation, StringFactory
Defined in:
lib/kuality-coeus/data_objects/proposal_development/personnel_attachments.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 = {}) ⇒ PersonnelAttachmentObject

Returns a new instance of PersonnelAttachmentObject.



10
11
12
13
14
15
16
17
18
19
# File 'lib/kuality-coeus/data_objects/proposal_development/personnel_attachments.rb', line 10

def initialize(browser, opts={})
  @browser = browser
  defaults = {
      person:      '::random::',
      type:        '::random::',
      description: random_alphanums(30)
  }
  set_options defaults.merge(opts)
  requires :document_id, :file_name
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



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

def description
  @description
end

#doc_typeObject

Returns the value of attribute doc_type.



8
9
10
# File 'lib/kuality-coeus/data_objects/proposal_development/personnel_attachments.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/personnel_attachments.rb', line 8

def document_id
  @document_id
end

#file_nameObject

Returns the value of attribute file_name.



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

def file_name
  @file_name
end

#personObject

Returns the value of attribute person.



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

def person
  @person
end

#typeObject

Returns the value of attribute type.



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

def type
  @type
end

Instance Method Details

#createObject



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/kuality-coeus/data_objects/proposal_development/personnel_attachments.rb', line 21

def create
  navigate
  on AbstractsAndAttachments do |attach|
    attach.expand_all
    fill_out attach, :person
    attach.personnel_attachment_description.fit @description
    attach.personnel_attachment_type.fit @type
    attach.personnel_attachment_file_name.set($file_folder+@file_name)
    attach.add_personnel_attachment
  end
end