Class: DAP::Enum

Inherits:
Object
  • Object
show all
Defined in:
lib/dap/enum.rb

Overview

Base class for DAP enumerations

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from(value) ⇒ Enum

Retreive an enumeration instance by value.

Parameters:

  • value (String)

    the enumeration string value

Returns:

  • (Enum)

    the enumeration instance



6
7
8
# File 'lib/dap/enum.rb', line 6

def self.from(value)
  values[value]
end

Instance Method Details

#to_sObject

The enumeration string value



11
12
13
# File 'lib/dap/enum.rb', line 11

def to_s
  @value
end

#to_wireObject

The enumeration string value, suitable for encoding



16
17
18
# File 'lib/dap/enum.rb', line 16

def to_wire
  @value
end