Class: CanvasFactory::SectionConfig
- Inherits:
-
Object
- Object
- CanvasFactory::SectionConfig
- Defined in:
- lib/japanda/canvas_factory/section_config.rb
Instance Attribute Summary collapse
-
#end_at ⇒ Object
Returns the value of attribute end_at.
-
#name ⇒ Object
Returns the value of attribute name.
-
#start_at ⇒ Object
Returns the value of attribute start_at.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ SectionConfig
constructor
A new instance of SectionConfig.
- #request_body ⇒ Object
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_at ⇒ Object
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 |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/japanda/canvas_factory/section_config.rb', line 3 def name @name end |
#start_at ⇒ Object
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_body ⇒ Object
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 |