Class: ApplicationInsights::Channel::Contracts::PageViewData
- Inherits:
-
JsonSerializable
- Object
- JsonSerializable
- ApplicationInsights::Channel::Contracts::PageViewData
- Defined in:
- lib/application_insights/channel/contracts/page_view_data.rb
Overview
Data contract class for type PageViewData.
Instance Method Summary collapse
-
#duration ⇒ Object
Gets the duration property.
-
#duration=(value) ⇒ Object
Sets the duration property.
-
#initialize(options = {}) ⇒ PageViewData
constructor
Initializes a new instance of the PageViewData class.
-
#measurements ⇒ Object
Gets the measurements property.
-
#measurements=(value) ⇒ Object
Sets the measurements property.
-
#name ⇒ Object
Gets the name property.
-
#name=(value) ⇒ Object
Sets the name property.
-
#properties ⇒ Object
Gets the properties property.
-
#properties=(value) ⇒ Object
Sets the properties property.
-
#url ⇒ Object
Gets the url property.
-
#url=(value) ⇒ Object
Sets the url property.
-
#ver ⇒ Object
Gets the ver property.
-
#ver=(value) ⇒ Object
Sets the ver property.
Methods inherited from JsonSerializable
Constructor Details
#initialize(options = {}) ⇒ PageViewData
Initializes a new instance of the PageViewData class.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/application_insights/channel/contracts/page_view_data.rb', line 9 def initialize(={}) defaults = { 'ver' => 2, 'url' => nil, 'name' => nil, 'duration' => nil, 'properties' => {}, 'measurements' => {} } values = { 'ver' => 2, 'name' => nil } super defaults, values, end |
Instance Method Details
#duration ⇒ Object
Gets the duration property.
62 63 64 65 66 |
# File 'lib/application_insights/channel/contracts/page_view_data.rb', line 62 def duration @values.fetch('duration') { @values['duration'] = nil } end |
#duration=(value) ⇒ Object
Sets the duration property.
69 70 71 72 73 74 75 |
# File 'lib/application_insights/channel/contracts/page_view_data.rb', line 69 def duration=(value) if value == @defaults['duration'] @values.delete 'duration' if @values.key? 'duration' else @values['duration'] = value end end |
#measurements ⇒ Object
Gets the measurements property.
94 95 96 97 98 |
# File 'lib/application_insights/channel/contracts/page_view_data.rb', line 94 def measurements @values.fetch('measurements') { @values['measurements'] = {} } end |
#measurements=(value) ⇒ Object
Sets the measurements property.
101 102 103 104 105 106 107 |
# File 'lib/application_insights/channel/contracts/page_view_data.rb', line 101 def measurements=(value) if value == @defaults['measurements'] @values.delete 'measurements' if @values.key? 'measurements' else @values['measurements'] = value end end |
#name ⇒ Object
Gets the name property.
52 53 54 |
# File 'lib/application_insights/channel/contracts/page_view_data.rb', line 52 def name @values['name'] end |
#name=(value) ⇒ Object
Sets the name property.
57 58 59 |
# File 'lib/application_insights/channel/contracts/page_view_data.rb', line 57 def name=(value) @values['name'] = value end |
#properties ⇒ Object
Gets the properties property.
78 79 80 81 82 |
# File 'lib/application_insights/channel/contracts/page_view_data.rb', line 78 def properties @values.fetch('properties') { @values['properties'] = {} } end |
#properties=(value) ⇒ Object
Sets the properties property.
85 86 87 88 89 90 91 |
# File 'lib/application_insights/channel/contracts/page_view_data.rb', line 85 def properties=(value) if value == @defaults['properties'] @values.delete 'properties' if @values.key? 'properties' else @values['properties'] = value end end |
#url ⇒ Object
Gets the url property.
36 37 38 39 40 |
# File 'lib/application_insights/channel/contracts/page_view_data.rb', line 36 def url @values.fetch('url') { @values['url'] = nil } end |
#url=(value) ⇒ Object
Sets the url property.
43 44 45 46 47 48 49 |
# File 'lib/application_insights/channel/contracts/page_view_data.rb', line 43 def url=(value) if value == @defaults['url'] @values.delete 'url' if @values.key? 'url' else @values['url'] = value end end |
#ver ⇒ Object
Gets the ver property.
26 27 28 |
# File 'lib/application_insights/channel/contracts/page_view_data.rb', line 26 def ver @values['ver'] end |
#ver=(value) ⇒ Object
Sets the ver property.
31 32 33 |
# File 'lib/application_insights/channel/contracts/page_view_data.rb', line 31 def ver=(value) @values['ver'] = value end |