Class: DegreeObject

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(browser, opts = {}) ⇒ DegreeObject

Returns a new instance of DegreeObject.



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

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

  defaults = {
      type:            '::random::',
      description:     random_alphanums_plus,
      graduation_year: Time.random(year_range: 35).strftime('%Y')
  }
  set_options(defaults.merge(opts))
  requires :document_id, :person
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



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

def description
  @description
end

#document_idObject

Returns the value of attribute document_id.



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

def document_id
  @document_id
end

#graduation_yearObject

Returns the value of attribute graduation_year.



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

def graduation_year
  @graduation_year
end

#personObject

Returns the value of attribute person.



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

def person
  @person
end

#schoolObject

Returns the value of attribute school.



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

def school
  @school
end

#typeObject

Returns the value of attribute type.



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

def type
  @type
end

Instance Method Details

#createObject



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

def create
  # This method assumes navigation was performed by the parent object
  on KeyPersonnel do |degrees|
    degrees.expand_all
    degrees.degree_type(@person).pick! @type
    degrees.degree_description(@person).fit @description
    fill_out_item @person, degrees, :graduation_year, :school
    degrees.add_degree(@person)
  end
end