Class: DataDomeRequest
- Inherits:
-
Object
- Object
- DataDomeRequest
- Defined in:
- lib/model/api/request.rb
Instance Attribute Summary collapse
-
#account ⇒ Object
readonly
Returns the value of attribute account.
-
#header ⇒ Object
readonly
Returns the value of attribute header.
-
#module ⇒ Object
readonly
Returns the value of attribute module.
-
#session ⇒ Object
readonly
Returns the value of attribute session.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(datadome_headers) ⇒ DataDomeRequest
constructor
A new instance of DataDomeRequest.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(datadome_headers) ⇒ DataDomeRequest
Returns a new instance of DataDomeRequest.
182 183 184 185 186 187 188 189 190 191 192 |
# File 'lib/model/api/request.rb', line 182 def initialize(datadome_headers) @module = DataDomeModule.new @header = datadome_headers # Do not forget headers truncation @header.truncate_attributes # Dynamic attributes that holds Event data when payload is created @account = {} @status = {} @session = {} @user = {} end |
Instance Attribute Details
#account ⇒ Object (readonly)
Returns the value of attribute account.
180 181 182 |
# File 'lib/model/api/request.rb', line 180 def account @account end |
#header ⇒ Object (readonly)
Returns the value of attribute header.
180 181 182 |
# File 'lib/model/api/request.rb', line 180 def header @header end |
#module ⇒ Object (readonly)
Returns the value of attribute module.
180 181 182 |
# File 'lib/model/api/request.rb', line 180 def module @module end |
#session ⇒ Object (readonly)
Returns the value of attribute session.
180 181 182 |
# File 'lib/model/api/request.rb', line 180 def session @session end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
180 181 182 |
# File 'lib/model/api/request.rb', line 180 def status @status end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
180 181 182 |
# File 'lib/model/api/request.rb', line 180 def user @user end |
Instance Method Details
#to_json(options = {}) ⇒ Object
194 195 196 197 198 199 200 201 202 203 204 |
# File 'lib/model/api/request.rb', line 194 def to_json( = {}) data = { module: @module.to_hash, header: @header.to_hash, account: @account, status: @status, session: @session, user: @user, } JSON.generate(data, ) end |