Class: WikidataPositionHistory::Report
- Inherits:
-
Object
- Object
- WikidataPositionHistory::Report
- Defined in:
- lib/wikidata_position_history/report.rb
Overview
The entire wikitext generated for this report
Instance Attribute Summary collapse
-
#position_id ⇒ Object
readonly
Returns the value of attribute position_id.
-
#template_class ⇒ Object
readonly
Returns the value of attribute template_class.
Instance Method Summary collapse
-
#initialize(position_id, template_class = ReportTemplate) ⇒ Report
constructor
A new instance of Report.
- #template_params ⇒ Object
- #wikitext ⇒ Object
Constructor Details
#initialize(position_id, template_class = ReportTemplate) ⇒ Report
Returns a new instance of Report.
149 150 151 152 |
# File 'lib/wikidata_position_history/report.rb', line 149 def initialize(position_id, template_class = ReportTemplate) @position_id = position_id @template_class = template_class end |
Instance Attribute Details
#position_id ⇒ Object (readonly)
Returns the value of attribute position_id.
154 155 156 |
# File 'lib/wikidata_position_history/report.rb', line 154 def position_id @position_id end |
#template_class ⇒ Object (readonly)
Returns the value of attribute template_class.
154 155 156 |
# File 'lib/wikidata_position_history/report.rb', line 154 def template_class @template_class end |
Instance Method Details
#template_params ⇒ Object
164 165 166 167 168 169 170 |
# File 'lib/wikidata_position_history/report.rb', line 164 def template_params { metadata: , table_rows: table_rows, sparql_url: sparql.wdqs_url, } end |
#wikitext ⇒ Object
156 157 158 159 160 161 162 |
# File 'lib/wikidata_position_history/report.rb', line 156 def wikitext return legislator_template if .legislator? return config.multimember_error_template if .constituency? && (.representative_count != 1) return no_items_output if mandates.empty? template_class.new(template_params).output end |