Class: Moodle2CC::CanvasCC::Models::Resource
- Inherits:
-
Object
- Object
- Moodle2CC::CanvasCC::Models::Resource
- Defined in:
- lib/moodle2cc/canvas_cc/models/resource.rb
Direct Known Subclasses
Constant Summary collapse
- WEB_CONTENT_TYPE =
'webcontent'
Instance Attribute Summary collapse
-
#dependencies ⇒ Object
Returns the value of attribute dependencies.
-
#files ⇒ Object
Returns the value of attribute files.
-
#href ⇒ Object
Returns the value of attribute href.
-
#identifier ⇒ Object
Returns the value of attribute identifier.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #attributes ⇒ Object
-
#initialize ⇒ Resource
constructor
A new instance of Resource.
Constructor Details
#initialize ⇒ Resource
Returns a new instance of Resource.
8 9 10 11 12 |
# File 'lib/moodle2cc/canvas_cc/models/resource.rb', line 8 def initialize @files = [] @dependencies = [] @ident_postfix = '' end |
Instance Attribute Details
#dependencies ⇒ Object
Returns the value of attribute dependencies.
6 7 8 |
# File 'lib/moodle2cc/canvas_cc/models/resource.rb', line 6 def dependencies @dependencies end |
#files ⇒ Object
Returns the value of attribute files.
6 7 8 |
# File 'lib/moodle2cc/canvas_cc/models/resource.rb', line 6 def files @files end |
#href ⇒ Object
Returns the value of attribute href.
6 7 8 |
# File 'lib/moodle2cc/canvas_cc/models/resource.rb', line 6 def href @href end |
#identifier ⇒ Object
Returns the value of attribute identifier.
6 7 8 |
# File 'lib/moodle2cc/canvas_cc/models/resource.rb', line 6 def identifier @identifier end |
#type ⇒ Object
Returns the value of attribute type.
6 7 8 |
# File 'lib/moodle2cc/canvas_cc/models/resource.rb', line 6 def type @type end |
Instance Method Details
#attributes ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/moodle2cc/canvas_cc/models/resource.rb', line 14 def attributes { href: href, type: type, identifier: identifier }.delete_if { |_, v| v.nil? } end |