Class: CanvasFactory::SectionConfig

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ SectionConfig



5
6
7
8
9
# File 'lib/japanda/canvas_factory/section_config.rb', line 5

def initialize(opts = {})
  @name = opts[:name] || "section-#{Time.now.to_i}"
  @start_at = opts[:start_at] || Time.now
  @end_at = opts[:end_at] || Time.now + (30 * 24 * 60 * 60)
end

Instance Attribute Details

#end_atObject

Returns the value of attribute end_at.



3
4
5
# File 'lib/japanda/canvas_factory/section_config.rb', line 3

def end_at
  @end_at
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/japanda/canvas_factory/section_config.rb', line 3

def name
  @name
end

#start_atObject

Returns the value of attribute start_at.



3
4
5
# File 'lib/japanda/canvas_factory/section_config.rb', line 3

def start_at
  @start_at
end

Instance Method Details

#request_bodyObject



11
12
13
14
15
16
17
18
19
# File 'lib/japanda/canvas_factory/section_config.rb', line 11

def request_body
  {
    course_section: {
      name: @name,
      start_at: @start_at,
      end_at: @end_at
    }
  }
end