Class: NzbGetPP::Par

Inherits:
Object
  • Object
show all
Defined in:
lib/nzbgetpp/par.rb

Constant Summary collapse

STATUSES =
{
  "0" => :not_checked,
  "1" => :cannot_repair,
  "2" => :repaired,
  "3" => :repairable,
}
FAILED =
{
  "0" => false,
  "1" => true,
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename, status, failed) ⇒ Par

Returns a new instance of Par.



19
20
21
22
23
# File 'lib/nzbgetpp/par.rb', line 19

def initialize(filename, status, failed)
  @filename = filename
  self.status = status
  self.failed = failed
end

Instance Attribute Details

#filenameObject (readonly)

Returns the value of attribute filename.



16
17
18
# File 'lib/nzbgetpp/par.rb', line 16

def filename
  @filename
end

#statusObject

Returns the value of attribute status.



16
17
18
# File 'lib/nzbgetpp/par.rb', line 16

def status
  @status
end

Instance Method Details

#failed=(nzbpp_parfailed) ⇒ Object



30
31
32
# File 'lib/nzbgetpp/par.rb', line 30

def failed=(nzbpp_parfailed)
  @failed = FAILED[nzbpp_parfailed]
end

#failed?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/nzbgetpp/par.rb', line 34

def failed?
  !!@failed
end