Class: CanvasCc::CanvasCC::Models::CanvasFile

Inherits:
Resource
  • Object
show all
Defined in:
lib/canvas_cc/canvas_cc/models/canvas_file.rb

Constant Summary collapse

WEB_RESOURCES =
'web_resources'

Constants inherited from Resource

Resource::WEB_CONTENT_TYPE

Instance Attribute Summary collapse

Attributes inherited from Resource

#dependencies, #files, #href, #identifier, #type

Instance Method Summary collapse

Methods inherited from Resource

#attributes

Constructor Details

#initializeCanvasFile

Returns a new instance of CanvasFile.



9
10
11
12
# File 'lib/canvas_cc/canvas_cc/models/canvas_file.rb', line 9

def initialize
  super
  @type = WEB_CONTENT_TYPE
end

Instance Attribute Details

#file_locationObject

Returns the value of attribute file_location.



7
8
9
# File 'lib/canvas_cc/canvas_cc/models/canvas_file.rb', line 7

def file_location
  @file_location
end

#file_pathObject

Returns the value of attribute file_path.



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

def file_path
  @file_path
end

#hiddenObject

Returns the value of attribute hidden.



7
8
9
# File 'lib/canvas_cc/canvas_cc/models/canvas_file.rb', line 7

def hidden
  @hidden
end

#lock_atObject

Returns the value of attribute lock_at.



7
8
9
# File 'lib/canvas_cc/canvas_cc/models/canvas_file.rb', line 7

def lock_at
  @lock_at
end

#lockedObject

Returns the value of attribute locked.



7
8
9
# File 'lib/canvas_cc/canvas_cc/models/canvas_file.rb', line 7

def locked
  @locked
end

#unlock_atObject

Returns the value of attribute unlock_at.



7
8
9
# File 'lib/canvas_cc/canvas_cc/models/canvas_file.rb', line 7

def unlock_at
  @unlock_at
end

#usage_rightsObject

Returns the value of attribute usage_rights.



7
8
9
# File 'lib/canvas_cc/canvas_cc/models/canvas_file.rb', line 7

def usage_rights
  @usage_rights
end

Instance Method Details

#licenseObject



20
21
22
23
24
25
26
27
# File 'lib/canvas_cc/canvas_cc/models/canvas_file.rb', line 20

def license
  case usage_rights
  when 'own_copyright', 'used_by_permission', 'fair_use'
    'private'
  else
    usage_rights
  end
end