Class: Germinate::Process
- Inherits:
-
Object
- Object
- Germinate::Process
- Defined in:
- lib/germinate/process.rb
Overview
A Process represents an external command which can be used to process a Hunk of text.
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #call(input) ⇒ Object
-
#initialize(name, command) ⇒ Process
constructor
A new instance of Process.
Constructor Details
#initialize(name, command) ⇒ Process
Returns a new instance of Process.
14 15 16 17 |
# File 'lib/germinate/process.rb', line 14 def initialize(name, command) @name = name @command = command end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
10 11 12 |
# File 'lib/germinate/process.rb', line 10 def command @command end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
9 10 11 |
# File 'lib/germinate/process.rb', line 9 def name @name end |
Instance Method Details
#call(input) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/germinate/process.rb', line 19 def call(input) if pipe? call_command_in_pipe(input) else call_command_on_temp_file(input) end end |