Class: Shellplay::Screen

Inherits:
Object
  • Object
show all
Defined in:
lib/shellplay/screen.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeScreen

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

#clearscreenObject (readonly)

Returns the value of attribute clearscreen.



4
5
6
# File 'lib/shellplay/screen.rb', line 4

def clearscreen
  @clearscreen
end

#custompromptObject (readonly)

Returns the value of attribute customprompt.



4
5
6
# File 'lib/shellplay/screen.rb', line 4

def customprompt
  @customprompt
end

#displayObject (readonly)

Returns the value of attribute display.



4
5
6
# File 'lib/shellplay/screen.rb', line 4

def display
  @display
end

#displaycommandObject (readonly)

Returns the value of attribute displaycommand.



4
5
6
# File 'lib/shellplay/screen.rb', line 4

def displaycommand
  @displaycommand
end

#playpromptObject (readonly)

Returns the value of attribute playprompt.



4
5
6
# File 'lib/shellplay/screen.rb', line 4

def playprompt
  @playprompt
end

#stderrObject (readonly)

Returns the value of attribute stderr.



4
5
6
# File 'lib/shellplay/screen.rb', line 4

def stderr
  @stderr
end

#stdinObject (readonly)

Returns the value of attribute stdin.



4
5
6
# File 'lib/shellplay/screen.rb', line 4

def stdin
  @stdin
end

#stdoutObject (readonly)

Returns the value of attribute stdout.



4
5
6
# File 'lib/shellplay/screen.rb', line 4

def stdout
  @stdout
end

#timespentObject (readonly)

Returns the value of attribute timespent.



4
5
6
# File 'lib/shellplay/screen.rb', line 4

def timespent
  @timespent
end

Instance Method Details

#exportObject



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