Class: ViewModel::CepcWrapper
- Inherits:
-
Object
- Object
- ViewModel::CepcWrapper
- Defined in:
- lib/view_model/cepc_wrapper.rb
Instance Attribute Summary collapse
-
#view_model ⇒ Object
readonly
Returns the value of attribute view_model.
Instance Method Summary collapse
- #get_report_type ⇒ Object
- #get_view_model ⇒ Object
-
#initialize(xml_doc, schema_type, additional_data = {}) ⇒ CepcWrapper
constructor
A new instance of CepcWrapper.
- #to_hash ⇒ Object
-
#to_report ⇒ Object
create hash for data requested by Open Data Communities hash keys will be turned into columns for expected csv.
- #type ⇒ Object
Constructor Details
#initialize(xml_doc, schema_type, additional_data = {}) ⇒ CepcWrapper
Returns a new instance of CepcWrapper.
5 6 7 8 9 |
# File 'lib/view_model/cepc_wrapper.rb', line 5 def initialize(xml_doc, schema_type, additional_data = {}) @view_model = build_view_model(xml_doc, schema_type) @summary = Presenter::Cepc::Summary.new(view_model) @report = Presenter::Cepc::Report.new(view_model, additional_data) end |
Instance Attribute Details
#view_model ⇒ Object (readonly)
Returns the value of attribute view_model.
3 4 5 |
# File 'lib/view_model/cepc_wrapper.rb', line 3 def view_model @view_model end |
Instance Method Details
#get_report_type ⇒ Object
25 26 27 |
# File 'lib/view_model/cepc_wrapper.rb', line 25 def get_report_type view_model.report_type end |
#get_view_model ⇒ Object
29 30 31 |
# File 'lib/view_model/cepc_wrapper.rb', line 29 def get_view_model view_model end |
#to_hash ⇒ Object
15 16 17 |
# File 'lib/view_model/cepc_wrapper.rb', line 15 def to_hash @summary.to_hash end |
#to_report ⇒ Object
create hash for data requested by Open Data Communities hash keys will be turned into columns for expected csv
21 22 23 |
# File 'lib/view_model/cepc_wrapper.rb', line 21 def to_report @report.to_hash end |
#type ⇒ Object
11 12 13 |
# File 'lib/view_model/cepc_wrapper.rb', line 11 def type :CEPC end |