Class: Tomo::Script
- Inherits:
-
Object
- Object
- Tomo::Script
- Defined in:
- lib/tomo/script.rb
Instance Attribute Summary collapse
-
#script ⇒ Object
readonly
Returns the value of attribute script.
Instance Method Summary collapse
- #echo? ⇒ Boolean
- #echo_string ⇒ Object
-
#initialize(script, echo: true, pty: false, raise_on_error: true, silent: false) ⇒ Script
constructor
A new instance of Script.
- #pty? ⇒ Boolean
- #raise_on_error? ⇒ Boolean
- #silent? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(script, echo: true, pty: false, raise_on_error: true, silent: false) ⇒ Script
Returns a new instance of Script.
7 8 9 10 11 12 13 14 |
# File 'lib/tomo/script.rb', line 7 def initialize(script, echo: true, pty: false, raise_on_error: true, silent: false) @script = script @echo = echo @pty = pty @raise_on_error = raise_on_error @silent = silent freeze end |
Instance Attribute Details
#script ⇒ Object (readonly)
Returns the value of attribute script.
5 6 7 |
# File 'lib/tomo/script.rb', line 5 def script @script end |
Instance Method Details
#echo? ⇒ Boolean
16 17 18 |
# File 'lib/tomo/script.rb', line 16 def echo? !!@echo end |
#echo_string ⇒ Object
20 21 22 23 24 |
# File 'lib/tomo/script.rb', line 20 def echo_string return nil unless echo? @echo == true ? script : @echo end |
#pty? ⇒ Boolean
26 27 28 |
# File 'lib/tomo/script.rb', line 26 def pty? !!@pty end |
#raise_on_error? ⇒ Boolean
30 31 32 |
# File 'lib/tomo/script.rb', line 30 def raise_on_error? !!@raise_on_error end |
#silent? ⇒ Boolean
34 35 36 |
# File 'lib/tomo/script.rb', line 34 def silent? !!@silent end |
#to_s ⇒ Object
38 39 40 |
# File 'lib/tomo/script.rb', line 38 def to_s script end |