lib/cucumber/helpers/core_ext.rb
# Converts a string to the specified primitive type. Useful because all Gherkin values are treated as strings.
Converts a string to the specified primitive type. Useful because all Gherkin values are treated as strings.
Converts a string to the specified primitive type . Useful because all Gherkin values are treated as strings .
def to_type(type)
    if type == Boolean
      self == "true"
    elsif type == Date
      Date.parse(self)
    elsif type == DateTime
      DateTime.parse(self)
    elsif type == Enum
      self.snake_case(:upper)
    elsif type == Float
      self.to_f
    elsif type == Integer
      self.to_i
    else
      self
    end
  end
def to_type ( type ) if type == Boolean self == "true" elsif type == Date Date . parse ( self ) elsif type == DateTime DateTime . parse ( self ) elsif type == Enum self . snake_case ( :upper ) elsif type == Float self . to_f elsif type == Integer self . to_i else self end end
Converts a string to the specified primitive type.
Converts a string to the specified primitive type .
# note: cannot use 'case type' as that expands to === which checks for instances of rather than type equality
type
<not_specific>