Class: API::Entities::Todo
- Inherits:
-
Grape::Entity
- Object
- Grape::Entity
- API::Entities::Todo
- Defined in:
- lib/api/entities/todo.rb
Instance Method Summary collapse
- #design_todo_target_url(todo) ⇒ Object
- #todo_target_anchor(todo) ⇒ Object
- #todo_target_class(target_type) ⇒ Object
Instance Method Details
#design_todo_target_url(todo) ⇒ Object
37 38 39 40 41 42 43 44 45 |
# File 'lib/api/entities/todo.rb', line 37 def design_todo_target_url(todo) design = todo.target = { anchor: todo_target_anchor(todo), vueroute: design.filename } ::Gitlab::Routing.url_helpers.designs_project_issue_url(design.project, design.issue, ) end |
#todo_target_anchor(todo) ⇒ Object
33 34 35 |
# File 'lib/api/entities/todo.rb', line 33 def todo_target_anchor(todo) "note_#{todo.note_id}" if todo.note_id? end |
#todo_target_class(target_type) ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/api/entities/todo.rb', line 25 def todo_target_class(target_type) # Ensure the `Key` type properly maps to the `SSHKey` entity target_type = "SSHKey" if target_type == "Key" # false as second argument prevents looking up in module hierarchy # see also https://gitlab.com/gitlab-org/gitlab-foss/issues/59719 ::API::Entities.const_get(target_type, false) end |