Method: Asana::Resources::Events#initialize

Defined in:
lib/asana/resource_includes/events.rb

#initialize(resource: required('resource'), client: required('client'), wait: 1, options: {}) ⇒ Events

Initializes a new Events instance, subscribed to a resource ID.

Parameters:

  • resource (String) (defaults to: required('resource'))

    a resource ID. Can be a task id or a workspace id.

  • client (Asana::Client) (defaults to: required('client'))

    a client to perform the requests.

  • wait (Integer) (defaults to: 1)

    the number of seconds to wait between each poll.

  • options (Hash) (defaults to: {})

    the request I/O options



35
36
37
38
39
40
41
42
43
44
45
# File 'lib/asana/resource_includes/events.rb', line 35

def initialize(resource: required('resource'),
               client: required('client'),
               wait: 1, options: {})
  @resource  = resource
  @client    = client
  @events    = []
  @wait      = wait
  @options   = options
  @sync      = nil
  @last_poll = nil
end