Class: Itly::Plugin::Snowplow::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/itly/plugin/snowplow/options.rb

Overview

Options for the Snowplow plugin class

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(endpoint:, protocol: 'http', method: 'get', buffer_size: nil, disabled: false) ⇒ Options

Instantiate a new Options

Parameters:

  • endpoint: (String)

    specify the Snowplow endpoint

  • protocol: (String) (defaults to: 'http')

    specify the protocol to connect to the Snowplow endpoint. Can be ‘http’ or ‘https’. Default to ‘http’

  • method: (String) (defaults to: 'get')

    specify the HTTP verb to use when sending events to the Snowplow endpoint. Can be ‘get’ or ‘post’. Default to ‘get’

  • buffer_size: (Integer) (defaults to: nil)

    specify the buffer size before flushing event to the Snowplow endpoint. Leave it to nil to set it’s default value. Default to 1 for GET method, and 10 for POST

  • disabled: (TrueClass/FalseClass) (defaults to: false)

    set to true to disable the plugin. Default to false



26
27
28
29
30
31
32
33
# File 'lib/itly/plugin/snowplow/options.rb', line 26

def initialize(endpoint:, protocol: 'http', method: 'get', buffer_size: nil, disabled: false)
  super()
  @endpoint = endpoint
  @protocol = protocol
  @method = method
  @buffer_size = buffer_size
  @disabled = disabled
end

Instance Attribute Details

#buffer_sizeObject (readonly)

Returns the value of attribute buffer_size.



12
13
14
# File 'lib/itly/plugin/snowplow/options.rb', line 12

def buffer_size
  @buffer_size
end

#disabledObject (readonly)

Returns the value of attribute disabled.



12
13
14
# File 'lib/itly/plugin/snowplow/options.rb', line 12

def disabled
  @disabled
end

#endpointObject (readonly)

Returns the value of attribute endpoint.



12
13
14
# File 'lib/itly/plugin/snowplow/options.rb', line 12

def endpoint
  @endpoint
end

#methodObject (readonly)

Returns the value of attribute method.



12
13
14
# File 'lib/itly/plugin/snowplow/options.rb', line 12

def method
  @method
end

#protocolObject (readonly)

Returns the value of attribute protocol.



12
13
14
# File 'lib/itly/plugin/snowplow/options.rb', line 12

def protocol
  @protocol
end