Sha256: 8991e3a002e1ed1314df458651fafec06166a09fe67dd845d2fb90cdc48483c1

Contents?: true

Size: 513 Bytes

Versions: 3

Compression:

Stored size: 513 Bytes

Contents

module ShellTastic
  class OutputFormatter
    attr_accessor :output, :pid, :error, 
      :command, :start, :stop,
      :total_time, :exitstatus

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

    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
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
shelltastic-1.0.0 lib/shelltastic/output_formatter.rb
shelltastic-0.5.0 lib/shelltastic/output_formatter.rb
shelltastic-0.4.0 lib/shelltastic/output_formatter.rb