Class: QuickBase::EventNotifier::EventNotification
- Inherits:
-
Object
- Object
- QuickBase::EventNotifier::EventNotification
- Defined in:
- lib/QuickBaseEventNotifier.rb
Overview
Event, notification, and checking policy
Instance Attribute Summary collapse
-
#notification ⇒ Object
readonly
Returns the value of attribute notification.
Instance Method Summary collapse
-
#initialize(tableEvent, notification = nil, eventCheckPolicy = nil) ⇒ EventNotification
constructor
A new instance of EventNotification.
- #method_missing(method, *args) ⇒ Object
- #validate(qbc) ⇒ Object
Constructor Details
#initialize(tableEvent, notification = nil, eventCheckPolicy = nil) ⇒ EventNotification
Returns a new instance of EventNotification.
377 378 379 380 381 382 383 384 385 |
# File 'lib/QuickBaseEventNotifier.rb', line 377 def initialize(tableEvent, notification=nil, eventCheckPolicy=nil) if tableEvent and tableEvent.is_a?(TableEvent) @tableEvent,@notification,@eventCheckPolicy=tableEvent,notification,eventCheckPolicy @notification = Notification.new if @notification.nil? @eventCheckPolicy = EventCheckPolicy.new if @eventCheckPolicy.nil? else raise "tableEvent must be TableEvent" end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 |
# File 'lib/QuickBaseEventNotifier.rb', line 387 def method_missing(method, *args) if method == :nextCheckTime @eventCheckPolicy.nextCheckTime elsif method == :setNextCheckTime @eventCheckPolicy.setNextCheckTime(args[0],args[1]) elsif method == :stopChecking? @eventCheckPolicy.stopChecking? elsif method == :numChecks @eventCheckPolicy.numChecks elsif method == :numSuccessfulChecks @eventCheckPolicy.numSuccessfulChecks elsif method == :eventOccurred? @tableEvent.eventOccurred?(@qbc) elsif method == :url @tableEvent.url elsif method == :tableEventNotificationMessage @tableEvent.tableEventNotificationMessage else super.method_missing(method) end end |
Instance Attribute Details
#notification ⇒ Object (readonly)
Returns the value of attribute notification.
375 376 377 |
# File 'lib/QuickBaseEventNotifier.rb', line 375 def notification @notification end |