Module: TrackerHub::Request::Setup

Included in:
TrackerHub::Request
Defined in:
lib/tracker_hub/request/setup.rb

Overview

Configure the request tracker

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configTrackerHub::Request::Config

Get the current configuration, instantiate a new object if nil

Note: each attribute can also be written through the config object

Examples:

> # get the current configuration
> TrackerHub::Request.config
> => #<TrackerHub::Request::Config:0x007fa574ad7390 ...>
>
> # set a specific value in the config
> TrackerHub::Request.config.app_version = '4.2'

Returns:


21
22
23
# File 'lib/tracker_hub/request/setup.rb', line 21

def config
  @config ||= self::Config.new
end

Instance Method Details

#setup {|config| ... } ⇒ TrackerHub::Request::Config

Setup configuration in block

Examples:

> TrackerHub::Request.setup do |config|
>   config.app_version = '4.2'
> end

Yields:

Returns:


36
37
38
# File 'lib/tracker_hub/request/setup.rb', line 36

def setup
  yield(config)
end