Class: ViewModel::SapWrapper

Inherits:
Object
  • Object
show all
Extended by:
Gem::Deprecate
Defined in:
lib/view_model/sap_wrapper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml_doc, schema_type, report_type = "3", additional_data = {}) ⇒ SapWrapper

Returns a new instance of SapWrapper.



5
6
7
8
9
10
11
12
13
# File 'lib/view_model/sap_wrapper.rb', line 5

def initialize(xml_doc, schema_type, report_type = "3", additional_data = {})
  @schema_type = schema_type
  @view_model = build_view_model(xml_doc, schema_type, report_type)
  @summary = Presenter::Sap::Summary.new(view_model)
  @certificate_summary = Presenter::Sap::CertificateSummary.new(view_model)
  @report = Presenter::Sap::Report.new(view_model, schema_type, additional_data)
  @recommendation_report = Presenter::Sap::RecommendationReport.new(view_model)
  @domestic_digest = Presenter::Sap::DomesticDigest.new(view_model, schema_type)
end

Instance Attribute Details

#schema_typeObject (readonly)

Returns the value of attribute schema_type.



3
4
5
# File 'lib/view_model/sap_wrapper.rb', line 3

def schema_type
  @schema_type
end

#view_modelObject (readonly)

Returns the value of attribute view_model.



3
4
5
# File 'lib/view_model/sap_wrapper.rb', line 3

def view_model
  @view_model
end

Instance Method Details

#get_view_modelObject



50
51
52
# File 'lib/view_model/sap_wrapper.rb', line 50

def get_view_model
  view_model
end

#to_certificate_summaryObject



23
24
25
# File 'lib/view_model/sap_wrapper.rb', line 23

def to_certificate_summary
  @certificate_summary.to_certificate_summary
end

#to_domestic_digestObject



39
40
41
# File 'lib/view_model/sap_wrapper.rb', line 39

def to_domestic_digest
  @domestic_digest.to_domestic_digest
end

#to_hashObject



19
20
21
# File 'lib/view_model/sap_wrapper.rb', line 19

def to_hash
  @summary.to_hash
end

#to_hash_niObject



27
28
29
# File 'lib/view_model/sap_wrapper.rb', line 27

def to_hash_ni
  @report.to_hash_ni
end

#to_hera_hashObject



43
44
45
# File 'lib/view_model/sap_wrapper.rb', line 43

def to_hera_hash
  to_domestic_digest
end

#to_recommendation_reportObject



35
36
37
# File 'lib/view_model/sap_wrapper.rb', line 35

def to_recommendation_report
  @recommendation_report.to_hash
end

#to_reportObject



31
32
33
# File 'lib/view_model/sap_wrapper.rb', line 31

def to_report
  @report.to_hash
end

#typeObject



15
16
17
# File 'lib/view_model/sap_wrapper.rb', line 15

def type
  view_model.type_of_assessment.to_sym
end