Class: Shellplay::Screen
- Inherits:
-
Object
- Object
- Shellplay::Screen
- Defined in:
- lib/shellplay/screen.rb
Instance Attribute Summary collapse
-
#clearscreen ⇒ Object
readonly
Returns the value of attribute clearscreen.
-
#customprompt ⇒ Object
readonly
Returns the value of attribute customprompt.
-
#display ⇒ Object
readonly
Returns the value of attribute display.
-
#displaycommand ⇒ Object
readonly
Returns the value of attribute displaycommand.
-
#playprompt ⇒ Object
readonly
Returns the value of attribute playprompt.
-
#stderr ⇒ Object
readonly
Returns the value of attribute stderr.
-
#stdin ⇒ Object
readonly
Returns the value of attribute stdin.
-
#stdout ⇒ Object
readonly
Returns the value of attribute stdout.
-
#timespent ⇒ Object
readonly
Returns the value of attribute timespent.
Instance Method Summary collapse
- #export ⇒ Object
- #import(hash) ⇒ Object
-
#initialize ⇒ Screen
constructor
A new instance of Screen.
Constructor Details
#initialize ⇒ Screen
Returns a new instance of Screen.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/shellplay/screen.rb', line 6 def initialize @displaycommand = true @playprompt = true @clearscreen = false @customprompt = nil @stdin = nil @stdout = nil @stderr = nil @timespent = 0 end |
Instance Attribute Details
#clearscreen ⇒ Object (readonly)
Returns the value of attribute clearscreen.
4 5 6 |
# File 'lib/shellplay/screen.rb', line 4 def clearscreen @clearscreen end |
#customprompt ⇒ Object (readonly)
Returns the value of attribute customprompt.
4 5 6 |
# File 'lib/shellplay/screen.rb', line 4 def customprompt @customprompt end |
#display ⇒ Object (readonly)
Returns the value of attribute display.
4 5 6 |
# File 'lib/shellplay/screen.rb', line 4 def display @display end |
#displaycommand ⇒ Object (readonly)
Returns the value of attribute displaycommand.
4 5 6 |
# File 'lib/shellplay/screen.rb', line 4 def displaycommand @displaycommand end |
#playprompt ⇒ Object (readonly)
Returns the value of attribute playprompt.
4 5 6 |
# File 'lib/shellplay/screen.rb', line 4 def playprompt @playprompt end |
#stderr ⇒ Object (readonly)
Returns the value of attribute stderr.
4 5 6 |
# File 'lib/shellplay/screen.rb', line 4 def stderr @stderr end |
#stdin ⇒ Object (readonly)
Returns the value of attribute stdin.
4 5 6 |
# File 'lib/shellplay/screen.rb', line 4 def stdin @stdin end |
#stdout ⇒ Object (readonly)
Returns the value of attribute stdout.
4 5 6 |
# File 'lib/shellplay/screen.rb', line 4 def stdout @stdout end |
#timespent ⇒ Object (readonly)
Returns the value of attribute timespent.
4 5 6 |
# File 'lib/shellplay/screen.rb', line 4 def timespent @timespent end |
Instance Method Details
#export ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/shellplay/screen.rb', line 28 def export { displaycommand: @displaycommand, playprompt: @playprompt, clearscreen: @clearscreen, customprompt: @customprompt, stdin: @stdin, stdout: @stdout, stderr: @stderr, timespent: @timespent } end |
#import(hash) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/shellplay/screen.rb', line 17 def import(hash) @displaycommand = !!hash['displaycommand'] @playprompt = !!hash['playprompt'] @clearscreen = !!hash['clearscreen'] @customprompt = hash['customprompt'] @stdin = hash['stdin'] @stdout = hash['stdout'] @stderr = hash['stderr'] @timespent = hash['timespent'] end |