Skip to content

Instantly share code, notes, and snippets.

@PavelPenkov
Created November 8, 2017 14:07
Show Gist options
  • Save PavelPenkov/85ed89acb6bcbf7d91ca717c31712510 to your computer and use it in GitHub Desktop.
Save PavelPenkov/85ed89acb6bcbf7d91ca717c31712510 to your computer and use it in GitHub Desktop.
class Workflow
attr_accessor :name, :inputs
def to_s
"workflow #{name} {\n".tap do |result|
inputs.each do |input|
result << "#{input.to_s}\n"
end
result << "}"
end
end
end
class FileInput
attr_accessor :name
def to_s
"File #{name}"
end
end
wdl = Workflow.new
wdl.name = 'hello'
file = FileInput.new
file.name = 'myfile'
wdl.inputs = [file]
wdl.to_s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment