Class: Restspec::Values::StatusCode

Inherits:
Struct
  • Object
show all
Defined in:
lib/restspec/values/status_code.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#number_or_symbolObject

Returns the value of attribute number_or_symbol

Returns:

  • (Object)

    the current value of number_or_symbol



3
4
5
# File 'lib/restspec/values/status_code.rb', line 3

def number_or_symbol
  @number_or_symbol
end

Instance Method Details

#valueObject



4
5
6
7
8
9
10
# File 'lib/restspec/values/status_code.rb', line 4

def value
  if number_or_symbol.is_a?(Symbol)
    Rack::Utils::SYMBOL_TO_STATUS_CODE.fetch(number_or_symbol)
  else
    number_or_symbol
  end
end