class ActionDispatch::Journey::Format

Experimental RBS support (using type sampling data from the type_fusion project).

# sig/action_dispatch/journey/visitors.rbs

class ActionDispatch::Journey::Format
  def evaluate: (Hash hash) -> String
end

def self.required_path(symbol)

def self.required_path(symbol)
  Parameter.new symbol, ESCAPE_PATH
end

def self.required_segment(symbol)

def self.required_segment(symbol)
  Parameter.new symbol, ESCAPE_SEGMENT
end

def evaluate(hash)

Experimental RBS support (using type sampling data from the type_fusion project).

type ActionDispatch__Journey__Format_evaluate_hash = gem | String | version | String | class | String | gem | String | version | String | gem | String | version | String | module | String | gem | String |  | gem | String | version | String | file | String | id | String | slug | String | gem | String | version | String | class | String | name | String | gem | String | version | String | id | String | gem | String | version | String | class_id | String | id | String | gem | String | version | String | module_id | String | id | String | gem | String | version | String | module | String | name | String | gem | String | version | String | guide | String

def evaluate: (ActionDispatch__Journey__Format_evaluate_hash hash) -> String

This signature was generated using 145 samples from 2 applications.

def evaluate(hash)
  parts = @parts.dup
  @parameters.each do |index|
    param = parts[index]
    value = hash[param.name]
    return "" if value.nil?
    parts[index] = param.escape value
  end
  @children.each { |index| parts[index] = parts[index].evaluate(hash) }
  parts.join
end

def initialize(parts)

def initialize(parts)
  @parts      = parts
  @children   = []
  @parameters = []
  parts.each_with_index do |object, i|
    case object
    when Journey::Format
      @children << i
    when Parameter
      @parameters << i
    end
  end
end