Class: CanvasFactory::Section

Inherits:
Object
  • Object
show all
Defined in:
lib/japanda/canvas_factory/section.rb

Overview

canvas section class

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(course_id, opts = {}, merge = true) ⇒ Section

Returns a new instance of Section.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/japanda/canvas_factory/section.rb', line 7

def initialize(course_id, opts = {}, merge = true)
  @course_id = course_id
  @request = {
    course_section: {
      name: "section-#{Time.now.to_i}",
      start_at: Time.now,
      end_at: Time.now + (30 * 24 * 60 * 60),
      restrict_enrollments_to_section_dates: false,
      # enable_sis_reactivation: false,
      # sis_section_id: nil
    }
  }
  @request = Mergie.deep_merge(@request, opts, merge)
  create_section
  self
end

Instance Attribute Details

#course_idObject (readonly)

Returns the value of attribute course_id.



4
5
6
# File 'lib/japanda/canvas_factory/section.rb', line 4

def course_id
  @course_id
end

#end_atObject (readonly)

Returns the value of attribute end_at.



4
5
6
# File 'lib/japanda/canvas_factory/section.rb', line 4

def end_at
  @end_at
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/japanda/canvas_factory/section.rb', line 4

def id
  @id
end

#integration_idObject (readonly)

Returns the value of attribute integration_id.



4
5
6
# File 'lib/japanda/canvas_factory/section.rb', line 4

def integration_id
  @integration_id
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/japanda/canvas_factory/section.rb', line 4

def name
  @name
end

#nonxlist_course_idObject (readonly)

Returns the value of attribute nonxlist_course_id.



4
5
6
# File 'lib/japanda/canvas_factory/section.rb', line 4

def nonxlist_course_id
  @nonxlist_course_id
end

#requestObject (readonly)

Returns the value of attribute request.



4
5
6
# File 'lib/japanda/canvas_factory/section.rb', line 4

def request
  @request
end

#responseObject (readonly)

Returns the value of attribute response.



4
5
6
# File 'lib/japanda/canvas_factory/section.rb', line 4

def response
  @response
end

#sis_course_idObject (readonly)

Returns the value of attribute sis_course_id.



4
5
6
# File 'lib/japanda/canvas_factory/section.rb', line 4

def sis_course_id
  @sis_course_id
end

#sis_import_idObject (readonly)

Returns the value of attribute sis_import_id.



4
5
6
# File 'lib/japanda/canvas_factory/section.rb', line 4

def sis_import_id
  @sis_import_id
end

#sis_section_idObject (readonly)

Returns the value of attribute sis_section_id.



4
5
6
# File 'lib/japanda/canvas_factory/section.rb', line 4

def sis_section_id
  @sis_section_id
end

#start_atObject (readonly)

Returns the value of attribute start_at.



4
5
6
# File 'lib/japanda/canvas_factory/section.rb', line 4

def start_at
  @start_at
end