Class: PuppetGenerator::Models::Exporter

Inherits:
FeduxOrg::Stdlib::Models::BaseModel
  • Object
show all
Extended by:
Forwardable
Includes:
FeduxOrg::Stdlib::Models::ClassBasedModel, FeduxOrg::Stdlib::Models::FilesystemBasedModel
Defined in:
lib/puppet_generator/models/exporter.rb

Overview

model for import filter

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, exporter) ⇒ Exporter

create new instance of filter model



18
19
20
21
22
# File 'lib/puppet_generator/models/exporter.rb', line 18

def initialize( name , exporter )
  super(name)

  @exporter = exporter
end

Class Method Details

.existing_destination?(destination) ⇒ Boolean

Returns:

  • (Boolean)


26
27
28
29
30
# File 'lib/puppet_generator/models/exporter.rb', line 26

def existing_destination?(destination)
  return true if File.exists? destination

  false
end

.valid_destination?(destination) ⇒ Boolean

Returns:

  • (Boolean)


32
33
34
35
36
# File 'lib/puppet_generator/models/exporter.rb', line 32

def valid_destination?(destination)
  return true if find( writes_to: destination, enabled: true )

  false
end

Instance Method Details

#convertObject

converts an object using the convert method of the stored filter



14
# File 'lib/puppet_generator/models/exporter.rb', line 14

def_delegator :@exporter, :write, :write