Class: ForemanTemplates::ExportResult
- Inherits:
-
Object
- Object
- ForemanTemplates::ExportResult
- Defined in:
- app/services/foreman_templates/export_result.rb
Instance Attribute Summary collapse
-
#additional_info ⇒ Object
readonly
Returns the value of attribute additional_info.
-
#exported ⇒ Object
readonly
Returns the value of attribute exported.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#template ⇒ Object
readonly
Returns the value of attribute template.
-
#template_file ⇒ Object
readonly
Returns the value of attribute template_file.
Instance Method Summary collapse
- #generic_info(additional_msg) ⇒ Object
-
#initialize(template, exported = true) ⇒ ExportResult
constructor
A new instance of ExportResult.
- #matching_filter ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(template, exported = true) ⇒ ExportResult
Returns a new instance of ExportResult.
5 6 7 8 9 10 |
# File 'app/services/foreman_templates/export_result.rb', line 5 def initialize(template, exported = true) @template = template @exported = exported @name = template.name @template_file = template.template_file end |
Instance Attribute Details
#additional_info ⇒ Object (readonly)
Returns the value of attribute additional_info.
3 4 5 |
# File 'app/services/foreman_templates/export_result.rb', line 3 def additional_info @additional_info end |
#exported ⇒ Object (readonly)
Returns the value of attribute exported.
3 4 5 |
# File 'app/services/foreman_templates/export_result.rb', line 3 def exported @exported end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'app/services/foreman_templates/export_result.rb', line 3 def name @name end |
#template ⇒ Object (readonly)
Returns the value of attribute template.
3 4 5 |
# File 'app/services/foreman_templates/export_result.rb', line 3 def template @template end |
#template_file ⇒ Object (readonly)
Returns the value of attribute template_file.
3 4 5 |
# File 'app/services/foreman_templates/export_result.rb', line 3 def template_file @template_file end |
Instance Method Details
#generic_info(additional_msg) ⇒ Object
26 27 28 29 30 31 |
# File 'app/services/foreman_templates/export_result.rb', line 26 def generic_info(additional_msg) @exported = false @additional_info = additional_msg Logging.logger('app').debug "Not exporting #{@template.name}: #{additional_msg}" self end |
#matching_filter ⇒ Object
22 23 24 |
# File 'app/services/foreman_templates/export_result.rb', line 22 def matching_filter generic_info "Skipping, 'name' filtered out based on 'filter' and 'negate' settings" end |
#to_h ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'app/services/foreman_templates/export_result.rb', line 12 def to_h { :id => template.id, :name => @name, :exported => @exported, :type => template.class.name.underscore, :additional_info => @additional_info } end |