Rails中的延迟方法是什么?它来自哪个图书馆?

时间:2016-04-05 15:26:41

标签: ruby-on-rails

我看到了这段代码:

Sub CustomLabels()

   Dim i, myCount, pt
   ActiveSheet.ChartObjects("myChart").Activate
   myCount = ActiveChart.SeriesCollection(1).Points.Count

   For i = 1 To myCount
       ActiveChart.SeriesCollection(1).Points(i).ApplyDataLabels
       ActiveChart.SeriesCollection(1).Points(i).DataLabel.Text = Range("D" & i + 1).Value
   Next i

End Sub

这是相关的测试:

Event.delay.create!(
  event_type: event_type,
  description: 'Automatically populated',
  date: Time.now.utc,
  eventable_id: subscription.id,
  eventable_type: subscription.class.name,
  app_context: app_context)

什么是and_call_original方法?什么是延迟方法?

1 个答案:

答案 0 :(得分:2)

:delay方法可能来自Delayed Job,一个排队框架:

Delayed Job Github Site

' and_call_original'是rspec框架中的委托者。

From rspec mocks