Class: Senkyoshi::FileResource
- Defined in:
- lib/senkyoshi/models/file_resource.rb
Overview
Class to represent a resource constructed from a single ‘dat’ file.
Direct Known Subclasses
Announcement, Blog, Content, Course, Forum, Gradebook, Group, QTI, StaffInfo
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id = nil) ⇒ FileResource
constructor
A new instance of FileResource.
- #iterate_xml(_xml, _pre_data) ⇒ Object
Methods inherited from Resource
#_find_directories, #_fix_path, #_matches_directory_xid?, #_search_and_replace, #cleanup, #fix_html, get_pre_data, #matches_xid?, #strip_xid
Constructor Details
#initialize(id = nil) ⇒ FileResource
Returns a new instance of FileResource.
10 11 12 |
# File 'lib/senkyoshi/models/file_resource.rb', line 10 def initialize(id = nil) @id = id end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/senkyoshi/models/file_resource.rb', line 8 def id @id end |
Class Method Details
.from(xml, pre_data, _resource_xids = nil) ⇒ Object
14 15 16 17 |
# File 'lib/senkyoshi/models/file_resource.rb', line 14 def self.from(xml, pre_data, _resource_xids = nil) resource = new(pre_data[:file_name]) resource.iterate_xml(xml, pre_data) end |
Instance Method Details
#iterate_xml(_xml, _pre_data) ⇒ Object
19 20 21 |
# File 'lib/senkyoshi/models/file_resource.rb', line 19 def iterate_xml(_xml, _pre_data) self end |