Class: MockServer::Model::SymbolizedEnum

Inherits:
Enum
  • Object
show all
Defined in:
lib/mockserver/model/enum.rb

Overview

Subclass of Enum that has a list of symbols as allowed values.

Direct Known Subclasses

BodyType, HTTPMethod, Scheme, TimeUnit

Instance Method Summary collapse

Methods inherited from Enum

#allowed_values, #initialize, #to_s

Constructor Details

This class inherits a constructor from MockServer::Model::Enum

Instance Method Details

#pre_process_value(value) ⇒ Symbol

Pre-process the value passed in and convert to a symbol

Parameters:

  • value (Object)

    a value used to instantiate the enum

Returns:

  • (Symbol)

    a symbolized version of the value passed in (first calls to_s)



43
44
45
# File 'lib/mockserver/model/enum.rb', line 43

def pre_process_value(value)
  value.to_s.to_sym
end