Class: ProposalAttachmentObject

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

Returns a new instance of ProposalAttachmentObject.



9
10
11
12
13
# File 'lib/kuality-coeus/data_objects/proposal_development/proposal_attachments.rb', line 9

def initialize(browser, opts={})
  @browser = browser
  set_options opts
  requires :document_id, :type, :file_name
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



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

def description
  @description
end

#doc_typeObject

Returns the value of attribute doc_type.



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

def doc_type
  @doc_type
end

#document_idObject

Returns the value of attribute document_id.



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

def document_id
  @document_id
end

#file_nameObject

Returns the value of attribute file_name.



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

def file_name
  @file_name
end

#statusObject

Returns the value of attribute status.



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

def status
  @status
end

#typeObject

Returns the value of attribute type.



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

def type
  @type
end

Instance Method Details

#createObject



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/kuality-coeus/data_objects/proposal_development/proposal_attachments.rb', line 15

def create
  navigate
  on AbstractsAndAttachments do |attach|
    attach.expand_all
    attach.proposal_attachment_type.select @type
    attach.proposal_attachment_description.fit @description
    attach.proposal_attachment_file_name.set($file_folder+@file_name)
    attach.attachment_status.fit @status
    attach.add_proposal_attachment
    raise "Unexpected attachment error" if attach.errors.size > 0
  end
end