Class: Moodle2CC::CanvasCC::Models::Resource

Inherits:
Object
  • Object
show all
Defined in:
lib/moodle2cc/canvas_cc/models/resource.rb

Direct Known Subclasses

CanvasFile, Page

Constant Summary collapse

WEB_CONTENT_TYPE =
'webcontent'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeResource

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

#dependenciesObject

Returns the value of attribute dependencies.



6
7
8
# File 'lib/moodle2cc/canvas_cc/models/resource.rb', line 6

def dependencies
  @dependencies
end

#filesObject

Returns the value of attribute files.



6
7
8
# File 'lib/moodle2cc/canvas_cc/models/resource.rb', line 6

def files
  @files
end

#hrefObject

Returns the value of attribute href.



6
7
8
# File 'lib/moodle2cc/canvas_cc/models/resource.rb', line 6

def href
  @href
end

#identifierObject

Returns the value of attribute identifier.



6
7
8
# File 'lib/moodle2cc/canvas_cc/models/resource.rb', line 6

def identifier
  @identifier
end

#typeObject

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

#attributesObject



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