Class: CanvasFactory::AssignmentConfig
- Inherits:
-
Object
- Object
- CanvasFactory::AssignmentConfig
- Defined in:
- lib/japanda/canvas_factory/assignment_config.rb
Instance Attribute Summary collapse
-
#due_at ⇒ Object
Returns the value of attribute due_at.
-
#grading_type ⇒ Object
Returns the value of attribute grading_type.
-
#name ⇒ Object
Returns the value of attribute name.
-
#points_possible ⇒ Object
Returns the value of attribute points_possible.
-
#published ⇒ Object
Returns the value of attribute published.
-
#submission_types ⇒ Object
Returns the value of attribute submission_types.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ AssignmentConfig
constructor
A new instance of AssignmentConfig.
- #request_body ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ AssignmentConfig
Returns a new instance of AssignmentConfig.
5 6 7 8 9 10 11 12 |
# File 'lib/japanda/canvas_factory/assignment_config.rb', line 5 def initialize(opts = {}) @name = opts[:name] || "Assignment-#{Time.now.to_i}" @grading_type = opts[:grading_type] || %w(pass_fail percent letter_grade gpa_scale points).sample @submission_types = opts[:submission_types] || ['online_text_entry'] @points_possible = opts[:points_possible] || 10 @due_at = opts[:due_at] || (DateTime.now + 1).iso8601 @published = opts[:published] || true end |
Instance Attribute Details
#due_at ⇒ Object
Returns the value of attribute due_at.
3 4 5 |
# File 'lib/japanda/canvas_factory/assignment_config.rb', line 3 def due_at @due_at end |
#grading_type ⇒ Object
Returns the value of attribute grading_type.
3 4 5 |
# File 'lib/japanda/canvas_factory/assignment_config.rb', line 3 def grading_type @grading_type end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/japanda/canvas_factory/assignment_config.rb', line 3 def name @name end |
#points_possible ⇒ Object
Returns the value of attribute points_possible.
3 4 5 |
# File 'lib/japanda/canvas_factory/assignment_config.rb', line 3 def points_possible @points_possible end |
#published ⇒ Object
Returns the value of attribute published.
3 4 5 |
# File 'lib/japanda/canvas_factory/assignment_config.rb', line 3 def published @published end |
#submission_types ⇒ Object
Returns the value of attribute submission_types.
3 4 5 |
# File 'lib/japanda/canvas_factory/assignment_config.rb', line 3 def submission_types @submission_types end |
Instance Method Details
#request_body ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/japanda/canvas_factory/assignment_config.rb', line 14 def request_body { assignment: { name: @name, grading_type: @grading_type, submission_types: @submission_types, points_possible: @points_possible, due_at: @due_at, published: @published } } end |