Sha256: 2911fe2bfd9a5588e5d821a292e00fa9b14940b4a80d07b3c31a5b73ef63a95d

Contents?: true

Size: 864 Bytes

Versions: 17

Compression:

Stored size: 864 Bytes

Contents

module ForemanTemplates
  class ExportResult
    attr_reader :template, :name, :template_file, :exported, :additional_info

    def initialize(template, exported = true)
      @template = template
      @exported = exported
      @name = template.name
      @template_file = template.template_file
    end

    def to_h
      {
        :id => template.id,
        :name => @name,
        :exported => @exported,
        :type => template.class.name.underscore,
        :additional_info => @additional_info
      }
    end

    def matching_filter
      generic_info "Skipping, 'name' filtered out based on 'filter' and 'negate' settings"
    end

    def generic_info(additional_msg)
      @exported = false
      @additional_info = additional_msg
      Logging.logger('app').debug "Not exporting #{@template.name}: #{additional_msg}"
      self
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
foreman_templates-10.0.2 app/services/foreman_templates/export_result.rb
foreman_templates-10.0.1 app/services/foreman_templates/export_result.rb
foreman_templates-10.0.0 app/services/foreman_templates/export_result.rb
foreman_templates-9.5.1 app/services/foreman_templates/export_result.rb
foreman_templates-9.5.0 app/services/foreman_templates/export_result.rb
foreman_templates-9.3.3 app/services/foreman_templates/export_result.rb
foreman_templates-9.3.2 app/services/foreman_templates/export_result.rb
foreman_templates-9.3.1 app/services/foreman_templates/export_result.rb
foreman_templates-9.4.0 app/services/foreman_templates/export_result.rb
foreman_templates-9.3.0 app/services/foreman_templates/export_result.rb
foreman_templates-9.2.0 app/services/foreman_templates/export_result.rb
foreman_templates-9.1.0 app/services/foreman_templates/export_result.rb
foreman_templates-9.0.2 app/services/foreman_templates/export_result.rb
foreman_templates-9.0.1 app/services/foreman_templates/export_result.rb
foreman_templates-9.0.0 app/services/foreman_templates/export_result.rb
foreman_templates-7.0.7 app/services/foreman_templates/export_result.rb
foreman_templates-8.0.0 app/services/foreman_templates/export_result.rb