Class: ForemanStatistics::Trend
- Inherits:
-
ApplicationRecord
- Object
- ApplicationRecord
- ForemanStatistics::Trend
- Defined in:
- app/models/foreman_statistics/trend.rb
Direct Known Subclasses
Class Method Summary collapse
- .build_trend(trend_params = {}) ⇒ Object
- .humanize_class_name(_name = nil) ⇒ Object
- .title_name ⇒ Object
Instance Method Summary collapse
Class Method Details
.build_trend(trend_params = {}) ⇒ Object
27 28 29 30 31 |
# File 'app/models/foreman_statistics/trend.rb', line 27 def self.build_trend(trend_params = {}) params = trend_params.dup params[:trendable_type] = 'ForemanPuppet::Environment' if params[:trendable_type] == 'Environment' params[:trendable_type] == 'FactName' ? FactTrend.new(params) : ForemanTrend.new(params) end |
.humanize_class_name(_name = nil) ⇒ Object
23 24 25 |
# File 'app/models/foreman_statistics/trend.rb', line 23 def self.humanize_class_name(_name = nil) super('Trend') end |
.title_name ⇒ Object
19 20 21 |
# File 'app/models/foreman_statistics/trend.rb', line 19 def self.title_name 'label'.freeze end |
Instance Method Details
#to_param ⇒ Object
15 16 17 |
# File 'app/models/foreman_statistics/trend.rb', line 15 def to_param Parameterizable.parameterize("#{id}-#{to_label}") end |