forked from ontoportal/ontoportal_web_ui
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
82 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# frozen_string_literal: true | ||
|
||
module KGCL | ||
module Renderers | ||
# Base class for generating GitHub issue content for ontology change requests | ||
class IssueContent | ||
attr_reader :params | ||
|
||
def initialize(params) | ||
@params = params | ||
end | ||
|
||
def render | ||
tr = KGCL::TemplateRenderer.new( | ||
title_template: title_template, | ||
body_template: body_template, | ||
bind_klass: self | ||
) | ||
tr.render | ||
end | ||
|
||
def concept_id | ||
@params[:concept_id] | ||
end | ||
|
||
def concept_label | ||
@params[:concept_label] | ||
end | ||
|
||
def curie | ||
@params[:curie] | ||
end | ||
|
||
def github_id | ||
@params[:github_id] | ||
end | ||
|
||
def orcid_id | ||
@params[:orcid_id] | ||
end | ||
|
||
def username | ||
@params[:username] | ||
end | ||
|
||
# These methods should be defined in subclasses to provide unique templates | ||
def title_template | ||
raise NotImplementedError, 'Subclasses must define a title_template' | ||
end | ||
|
||
def body_template | ||
raise NotImplementedError, 'Subclasses must define a body_template' | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters