Class: Wes::Data::API::Model::Submission
- Inherits:
-
Base
- Object
- Base
- Wes::Data::API::Model::Submission
show all
- Defined in:
- lib/wes/data/api/model/submission.rb
Instance Attribute Summary
Attributes inherited from Base
#attributes
Instance Method Summary
collapse
Methods inherited from Base
#exist?, #id, #initialize
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Wes::Data::API::Model::Base
Instance Method Details
#approve ⇒ Object
13
14
15
|
# File 'lib/wes/data/api/model/submission.rb', line 13
def approve
update(state: 'approved')
end
|
#complete ⇒ Object
9
10
11
|
# File 'lib/wes/data/api/model/submission.rb', line 9
def complete
update(completed: true) unless @attributes.completed
end
|
#decline ⇒ Object
17
18
19
|
# File 'lib/wes/data/api/model/submission.rb', line 17
def decline
update(state: 'declined')
end
|
#videos(fetch: false) ⇒ Object
21
22
23
24
25
26
|
# File 'lib/wes/data/api/model/submission.rb', line 21
def videos(fetch: false)
records = fetch ? fetch_videos : @attributes.videos
map_objects(
records, Wes::Data::API::Model::Video
)
end
|