class Shellplay::Screen

Attributes

clearscreen[R]
customprompt[R]
display[R]
displaycommand[R]
playprompt[R]
stderr[R]
stdin[R]
stdout[R]
timespent[R]

Public Class Methods

new() click to toggle source
# 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

Public Instance Methods

export() click to toggle source

transfroms a screen object into a hash

# 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) click to toggle source

transforms a hash into a screen object

# 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