Class: Tex2png::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/tex2png/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cmd, io) ⇒ Result

Returns a new instance of Result.



5
6
7
8
# File 'lib/tex2png/result.rb', line 5

def initialize(cmd, io)
  @cmd = cmd
  @raw = io
end

Instance Attribute Details

#cmdObject (readonly)

Returns the value of attribute cmd.



3
4
5
# File 'lib/tex2png/result.rb', line 3

def cmd
  @cmd
end

#outputObject (readonly)

Returns the value of attribute output.



3
4
5
# File 'lib/tex2png/result.rb', line 3

def output
  @output
end

#rawObject (readonly)

Returns the value of attribute raw.



3
4
5
# File 'lib/tex2png/result.rb', line 3

def raw
  @raw
end

Instance Method Details

#raise!Object



18
19
20
# File 'lib/tex2png/result.rb', line 18

def raise!
  ExcutionError.raise!("#{cmd} - #{output}") {!success?}
end

#success?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/tex2png/result.rb', line 14

def success?
  @success ||= Process.wait2(raw.pid)[1].success?
end