Class: Atatus::Context Private
- Inherits:
-
Object
- Object
- Atatus::Context
- Defined in:
- lib/atatus/context.rb,
lib/atatus/context/user.rb,
lib/atatus/context/company.rb,
lib/atatus/context/request.rb,
lib/atatus/context/response.rb,
lib/atatus/context/request/url.rb,
lib/atatus/context/request/socket.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Defined Under Namespace
Classes: Company, Framework, Request, Response, Service, User
Instance Attribute Summary collapse
- #company ⇒ Object private
- #custom ⇒ Object readonly private
- #labels ⇒ Object readonly private
- #request ⇒ Object private
- #response ⇒ Object private
- #response_body ⇒ Object private
- #service ⇒ Object readonly private
- #user ⇒ Object private
Instance Method Summary collapse
- #empty? ⇒ Boolean private
-
#initialize(custom: {}, labels: {}, user: nil, service: nil) ⇒ Context
constructor
private
A new instance of Context.
- #set_service(framework_name: nil, framework_version: nil) ⇒ Object private
Constructor Details
#initialize(custom: {}, labels: {}, user: nil, service: nil) ⇒ Context
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Context.
30 31 32 33 34 35 |
# File 'lib/atatus/context.rb', line 30 def initialize(custom: {}, labels: {}, user: nil, service: nil) @custom = custom @labels = labels @user = user || User.new @service = service end |
Instance Attribute Details
#company ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
42 43 44 |
# File 'lib/atatus/context.rb', line 42 def company @company end |
#custom ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
41 42 43 |
# File 'lib/atatus/context.rb', line 41 def custom @custom end |
#labels ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
41 42 43 |
# File 'lib/atatus/context.rb', line 41 def labels @labels end |
#request ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
40 41 42 |
# File 'lib/atatus/context.rb', line 40 def request @request end |
#response ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
40 41 42 |
# File 'lib/atatus/context.rb', line 40 def response @response end |
#response_body ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
42 43 44 |
# File 'lib/atatus/context.rb', line 42 def response_body @response_body end |
#service ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
41 42 43 |
# File 'lib/atatus/context.rb', line 41 def service @service end |
#user ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
40 41 42 |
# File 'lib/atatus/context.rb', line 40 def user @user end |
Instance Method Details
#empty? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
44 45 46 47 48 49 50 51 52 |
# File 'lib/atatus/context.rb', line 44 def empty? return false if labels.any? return false if custom.any? return false if user.any? return false if service return false if request || response true end |
#set_service(framework_name: nil, framework_version: nil) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
54 55 56 57 58 |
# File 'lib/atatus/context.rb', line 54 def set_service(framework_name: nil, framework_version: nil) @service = Service.new( Framework.new(framework_name, framework_version) ) end |