Class: PuppetGenerator::Importers::Stdin

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet_generator/importers/stdin.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#linesObject (readonly)

Returns the value of attribute lines.



4
5
6
# File 'lib/puppet_generator/importers/stdin.rb', line 4

def lines
  @lines
end

Instance Method Details

#read(input) ⇒ Object



6
7
8
# File 'lib/puppet_generator/importers/stdin.rb', line 6

def read( input )
  $stdin.readlines.collect { |l| l.strip.chomp }
end

#reads_from?(source) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/puppet_generator/importers/stdin.rb', line 10

def reads_from?(source)
  source == 'stdin'
end