跳至内容 跳至搜索
方法
A
C
N
包含的模块

属性

[R] responses

类公共方法

new(context, &block)

# File actionmailer/lib/action_mailer/collector.rb, line 12
def initialize(context, &block)
  @context = context
  @responses = []
  @default_render = block
end

实例公共方法

all(*args, &block)

别名:any

any(*args, &block)

也称为:all
# File actionmailer/lib/action_mailer/collector.rb, line 18
def any(*args, &block)
  options = args.extract_options!
  raise ArgumentError, "You have to supply at least one format" if args.empty?
  args.each { |type| send(type, options.dup, &block) }
end

custom(mime, options = {})

# File actionmailer/lib/action_mailer/collector.rb, line 25
def custom(mime, options = {})
  options.reverse_merge!(content_type: mime.to_s)
  @context.formats = [mime.to_sym]
  options[:body] = block_given? ? yield : @default_render.call
  @responses << options
end