Module: RaygunClient::Controls::Data

Defined in:
lib/raygun_client/controls/data.rb

Defined Under Namespace

Modules: JSON

Class Method Summary collapse

Class Method Details

.custom_dataObject



35
36
37
# File 'lib/raygun_client/controls/data.rb', line 35

def self.custom_data
  { 'someKey' => 'some value' }
end

.example(custom_data = nil, tags = nil, time: nil) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/raygun_client/controls/data.rb', line 4

def self.example(custom_data=nil, tags=nil, time: nil)
  custom_data ||= self.custom_data
  tags ||= self.tags
  time ||= self.time

  data = RaygunClient::Data.build

  data.occurred_time = time
  data.machine_name = machine_name
  data.tags = tags
  data.custom_data = custom_data

  data.client = RaygunClient::Data::ClientInfo.build

  data.error = Controls::ErrorData.example

  data
end

.machine_nameObject



27
28
29
# File 'lib/raygun_client/controls/data.rb', line 27

def self.machine_name
  'some machine name'
end

.tagsObject



31
32
33
# File 'lib/raygun_client/controls/data.rb', line 31

def self.tags
  ['some-tag']
end

.timeObject



23
24
25
# File 'lib/raygun_client/controls/data.rb', line 23

def self.time
  ::Controls::Time.example
end