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