Class: PPE_API::User
- Inherits:
-
Object
- Object
- PPE_API::User
- Includes:
- HappyMapper
- Defined in:
- lib/ppe_api/user.rb
Instance Method Summary collapse
Instance Method Details
#completed_tasks ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/ppe_api/user.rb', line 21 def completed_tasks exports.inject(0) do |sum,ex| if ex.task_status == DR::Config.import_state_map[:completed] sum+=1 end sum end end |
#exports ⇒ Object
16 17 18 |
# File 'lib/ppe_api/user.rb', line 16 def exports Export.find_all_by_user_id(id) end |
#imports ⇒ Object
30 31 32 |
# File 'lib/ppe_api/user.rb', line 30 def imports Import.find_all_by_user_id(id) end |
#to_xml(options = {}) ⇒ Object
34 35 36 |
# File 'lib/ppe_api/user.rb', line 34 def to_xml(={}) self.as_json.to_xml({:root => "user"}.merge()) end |