Class: ShellTastic::OutputFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/shelltastic/output_formatter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#commandObject

Returns the value of attribute command.



3
4
5
# File 'lib/shelltastic/output_formatter.rb', line 3

def command
  @command
end

#errorObject

Returns the value of attribute error.



3
4
5
# File 'lib/shelltastic/output_formatter.rb', line 3

def error
  @error
end

#exitstatusObject

Returns the value of attribute exitstatus.



3
4
5
# File 'lib/shelltastic/output_formatter.rb', line 3

def exitstatus
  @exitstatus
end

#outputObject

Returns the value of attribute output.



3
4
5
# File 'lib/shelltastic/output_formatter.rb', line 3

def output
  @output
end

#pidObject

Returns the value of attribute pid.



3
4
5
# File 'lib/shelltastic/output_formatter.rb', line 3

def pid
  @pid
end

#startObject

Returns the value of attribute start.



3
4
5
# File 'lib/shelltastic/output_formatter.rb', line 3

def start
  @start
end

#stopObject

Returns the value of attribute stop.



3
4
5
# File 'lib/shelltastic/output_formatter.rb', line 3

def stop
  @stop
end

#total_timeObject

Returns the value of attribute total_time.



3
4
5
# File 'lib/shelltastic/output_formatter.rb', line 3

def total_time
  @total_time
end

Instance Method Details

#build(args) ⇒ Object



7
8
9
10
11
# File 'lib/shelltastic/output_formatter.rb', line 7

def build(args)
  args.each_pair do |key, value|
    send("#{key}=",value)
  end
end

#inspectObject



13
14
15
16
17
18
19
20
21
22
# File 'lib/shelltastic/output_formatter.rb', line 13

def inspect
  hsh = {}
  meths =  self.class.instance_methods(false)  - [:build, :inspect]
  meths.each do |meth|
    if meth !~ /=/
      hsh.store(meth.to_sym,self.method(meth).call)
    end
  end
  hsh
end