Class: AcademicCalendar

Inherits:
Object
  • Object
show all
Includes:
DataFactory, DateFactory, Foundry, StringFactory, Workflows
Defined in:
lib/sambal-kuali/data_objects/academic_calendar.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Workflows

#go_to_academic_calendar, #go_to_calendar_search, #go_to_create_course_offerings, #go_to_create_population, #go_to_display_schedule_of_classes, #go_to_holiday_calendar, #go_to_manage_course_offerings, #go_to_manage_population, #go_to_perform_rollover, #go_to_rollover_details, #log_in, #logged_in_user

Constructor Details

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

Returns a new instance of AcademicCalendar.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/sambal-kuali/data_objects/academic_calendar.rb', line 12

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

  defaults = {
      :name=>random_alphanums.strip,
      :start_date=>"09/01/#{next_year[:year]}",
      :end_date=>"06/25/#{next_year[:year] + 1}",
      :organization=>"Registrar's Office"
  }
  options = defaults.merge(opts)
  set_options(options)
end

Instance Attribute Details

#end_dateObject

Returns the value of attribute end_date.



9
10
11
# File 'lib/sambal-kuali/data_objects/academic_calendar.rb', line 9

def end_date
  @end_date
end

#eventsObject

Returns the value of attribute events.



9
10
11
# File 'lib/sambal-kuali/data_objects/academic_calendar.rb', line 9

def events
  @events
end

#holidaysObject

Returns the value of attribute holidays.



9
10
11
# File 'lib/sambal-kuali/data_objects/academic_calendar.rb', line 9

def holidays
  @holidays
end

#nameObject

Returns the value of attribute name.



9
10
11
# File 'lib/sambal-kuali/data_objects/academic_calendar.rb', line 9

def name
  @name
end

#organizationObject

Returns the value of attribute organization.



9
10
11
# File 'lib/sambal-kuali/data_objects/academic_calendar.rb', line 9

def organization
  @organization
end

#start_dateObject

Returns the value of attribute start_date.



9
10
11
# File 'lib/sambal-kuali/data_objects/academic_calendar.rb', line 9

def start_date
  @start_date
end

#termsObject

Returns the value of attribute terms.



9
10
11
# File 'lib/sambal-kuali/data_objects/academic_calendar.rb', line 9

def terms
  @terms
end

Instance Method Details

#copy_from(name) ⇒ Object



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/sambal-kuali/data_objects/academic_calendar.rb', line 39

def copy_from(name)
  go_to_academic_calendar
  if right_source? name
    on CreateAcadCalendar do |page|
      page.name.set @name
      page.start_date.set @start_date
      page.end_date.set @end_date
    end
  else
    on CreateAcadCalendar do |page|
      page.choose_different_calendar
    end
    on CalendarSearch do |page|
      page.search_for "Academic Calendar", name
      page.copy name
    end
    on EditAcademicCalendar do |page|
      page.academic_calendar_name.set @name
      page.organization.select @organization
      page.calendar_start_date.set @start_date
      page.calendar_end_date.set @end_date
    end
  end
  on EditAcademicCalendar do |page|
    page.save
  end
end

#createObject



25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/sambal-kuali/data_objects/academic_calendar.rb', line 25

def create
  go_to_academic_calendar
  on CreateAcadCalendar do |page|
    page.start_blank_calendar
  end
  on EditAcademicCalendar do |page|
    page.academic_calendar_name.set @name
    page.organization.select @organization
    page.calendar_start_date.set @start_date
    page.calendar_end_date.set @end_date
    page.save
  end
end

#make_officialObject



84
85
86
87
88
# File 'lib/sambal-kuali/data_objects/academic_calendar.rb', line 84

def make_official
  on EditAcademicCalendar do |page|
    page.make_official
  end
end

#right_source?(name) ⇒ Boolean

Returns:

  • (Boolean)


74
75
76
77
78
79
80
81
82
# File 'lib/sambal-kuali/data_objects/academic_calendar.rb', line 74

def right_source?(name)
  on CreateAcadCalendar do |page|
    if page.source_name == name
      return true
    else
      return false
    end
  end
end

#searchObject



67
68
69
70
71
72
# File 'lib/sambal-kuali/data_objects/academic_calendar.rb', line 67

def search
  go_to_calendar_search
  on CalendarSearch do |page|
    page.search_for "Academic Calendar", @name
  end
end