Class: Sym::App::Output::Base
Class Attribute Summary collapse
-
.outputs ⇒ Object
Returns the value of attribute outputs.
Instance Attribute Summary collapse
-
#kernel ⇒ Object
Returns the value of attribute kernel.
-
#opts ⇒ Object
Returns the value of attribute opts.
-
#stderr ⇒ Object
Returns the value of attribute stderr.
-
#stdin ⇒ Object
Returns the value of attribute stdin.
-
#stdout ⇒ Object
Returns the value of attribute stdout.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(opts, stdin = $stdin, stdout = $stdout, stderr = $stderr, kernel = nil) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(opts, stdin = $stdin, stdout = $stdout, stderr = $stderr, kernel = nil) ⇒ Base
Returns a new instance of Base.
9 10 11 12 13 14 15 |
# File 'lib/sym/app/output/base.rb', line 9 def initialize(opts, stdin = $stdin, stdout = $stdout, stderr = $stderr, kernel = nil) self.opts = opts self.stdin = stdin self.stdout = stdout self.stderr = stderr self.kernel = kernel end |
Class Attribute Details
.outputs ⇒ Object
Returns the value of attribute outputs.
19 20 21 |
# File 'lib/sym/app/output/base.rb', line 19 def outputs @outputs end |
Instance Attribute Details
#kernel ⇒ Object
Returns the value of attribute kernel.
7 8 9 |
# File 'lib/sym/app/output/base.rb', line 7 def kernel @kernel end |
#opts ⇒ Object
Returns the value of attribute opts.
7 8 9 |
# File 'lib/sym/app/output/base.rb', line 7 def opts @opts end |
#stderr ⇒ Object
Returns the value of attribute stderr.
7 8 9 |
# File 'lib/sym/app/output/base.rb', line 7 def stderr @stderr end |
#stdin ⇒ Object
Returns the value of attribute stdin.
7 8 9 |
# File 'lib/sym/app/output/base.rb', line 7 def stdin @stdin end |
#stdout ⇒ Object
Returns the value of attribute stdout.
7 8 9 |
# File 'lib/sym/app/output/base.rb', line 7 def stdout @stdout end |
Class Method Details
.append(output_klass) ⇒ Object
21 22 23 24 25 |
# File 'lib/sym/app/output/base.rb', line 21 def append(output_klass) outputs << output_klass if outputs.is_a?(Array) raise "Cannot append #{output_class} after #outputs has been converted to a Hash" \ unless outputs.is_a?(Array) end |
.map_outputs! ⇒ Object
27 28 29 30 31 32 |
# File 'lib/sym/app/output/base.rb', line 27 def map_outputs! klasses = self.outputs self.outputs = Hash.new klasses.each { |k| self.outputs[k.required_option] = k } outputs end |
.options_to_outputs ⇒ Object
34 35 36 37 |
# File 'lib/sym/app/output/base.rb', line 34 def map_outputs! if outputs.is_a?(Array) outputs end |