Class: RTransmission::Types::Status

Inherits:
RTransmission::Type show all
Defined in:
lib/rtransmission/types/status.rb

Constant Summary collapse

MAP =
{1 => :check_wait, 2 => :check, 4 => :download, 8 => :seed, 16 => :stopped}

Class Method Summary collapse

Methods inherited from RTransmission::Type

attribute, #initialize, map, type_to_class

Constructor Details

This class inherits a constructor from RTransmission::Type

Class Method Details

.unmap(value) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/rtransmission/types/status.rb', line 10

def self.unmap(value)
  result = []
  MAP.each do |mask, status|
    result << status if mask & value != 0
  end

  result
end