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
transfroms a screen object into a hash.
-
#import(hash) ⇒ Object
transforms a hash into a screen object.
-
#initialize ⇒ Screen
constructor
A new instance of Screen.
Constructor Details
#initialize ⇒ Screen
Returns a new instance of Screen.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/shellplay/screen.rb', line 7 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.
5 6 7 |
# File 'lib/shellplay/screen.rb', line 5 def clearscreen @clearscreen end |
#customprompt ⇒ Object (readonly)
Returns the value of attribute customprompt.
5 6 7 |
# File 'lib/shellplay/screen.rb', line 5 def customprompt @customprompt end |
#display ⇒ Object (readonly)
Returns the value of attribute display.
5 6 7 |
# File 'lib/shellplay/screen.rb', line 5 def display @display end |
#displaycommand ⇒ Object (readonly)
Returns the value of attribute displaycommand.
5 6 7 |
# File 'lib/shellplay/screen.rb', line 5 def displaycommand @displaycommand end |
#playprompt ⇒ Object (readonly)
Returns the value of attribute playprompt.
5 6 7 |
# File 'lib/shellplay/screen.rb', line 5 def playprompt @playprompt end |
#stderr ⇒ Object (readonly)
Returns the value of attribute stderr.
5 6 7 |
# File 'lib/shellplay/screen.rb', line 5 def stderr @stderr end |
#stdin ⇒ Object (readonly)
Returns the value of attribute stdin.
5 6 7 |
# File 'lib/shellplay/screen.rb', line 5 def stdin @stdin end |
#stdout ⇒ Object (readonly)
Returns the value of attribute stdout.
5 6 7 |
# File 'lib/shellplay/screen.rb', line 5 def stdout @stdout end |
#timespent ⇒ Object (readonly)
Returns the value of attribute timespent.
5 6 7 |
# File 'lib/shellplay/screen.rb', line 5 def timespent @timespent end |
Instance Method Details
#export ⇒ Object
transfroms a screen object into a hash
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/shellplay/screen.rb', line 31 def export { displaycommand: @displaycommand, playprompt: @playprompt, clearscreen: @clearscreen, customprompt: @customprompt, stdin: @stdin, stdout: @stdout, stderr: @stderr, timespent: @timespent } end |
#import(hash) ⇒ Object
transforms a hash into a screen object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/shellplay/screen.rb', line 19 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 |