Class: ForemanOpenscap::HostReportDashboard::Data
- Inherits:
-
Object
- Object
- ForemanOpenscap::HostReportDashboard::Data
- Defined in:
- app/services/foreman_openscap/host_report_dashboard/data.rb
Instance Attribute Summary collapse
-
#latest_report ⇒ Object
readonly
Returns the value of attribute latest_report.
-
#report ⇒ Object
readonly
Returns the value of attribute report.
Instance Method Summary collapse
- #has_data? ⇒ Boolean
-
#initialize(policy, host) ⇒ Data
constructor
A new instance of Data.
Constructor Details
#initialize(policy, host) ⇒ Data
Returns a new instance of Data.
5 6 7 8 9 10 11 |
# File 'app/services/foreman_openscap/host_report_dashboard/data.rb', line 5 def initialize(policy, host) @latest_report = ::ForemanOpenscap::ArfReport.latest_of_policy(policy) .where(:host_id => host.id) .order('created_at DESC').first @report = {} fetch_data end |
Instance Attribute Details
#latest_report ⇒ Object (readonly)
Returns the value of attribute latest_report.
3 4 5 |
# File 'app/services/foreman_openscap/host_report_dashboard/data.rb', line 3 def latest_report @latest_report end |
#report ⇒ Object
Returns the value of attribute report.
3 4 5 |
# File 'app/services/foreman_openscap/host_report_dashboard/data.rb', line 3 def report @report end |
Instance Method Details
#has_data? ⇒ Boolean
13 14 15 |
# File 'app/services/foreman_openscap/host_report_dashboard/data.rb', line 13 def has_data? latest_report.present? end |