Class: Atatus::Context::Company Private
- Inherits:
-
Object
- Object
- Atatus::Context::Company
- Defined in:
- lib/atatus/context/company.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.
Instance Attribute Summary collapse
- #id ⇒ Object private
Class Method Summary collapse
- .infer(config, record) ⇒ Object private
Instance Method Summary collapse
- #any? ⇒ Boolean private
- #empty? ⇒ Boolean private
-
#initialize(id: nil) ⇒ Company
constructor
private
A new instance of Company.
Constructor Details
#initialize(id: nil) ⇒ Company
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 Company.
7 8 9 |
# File 'lib/atatus/context/company.rb', line 7 def initialize(id: nil) @id = id end |
Instance Attribute Details
#id ⇒ 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.
19 20 21 |
# File 'lib/atatus/context/company.rb', line 19 def id @id end |
Class Method Details
.infer(config, record) ⇒ 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.
11 12 13 14 15 16 17 |
# File 'lib/atatus/context/company.rb', line 11 def self.infer(config, record) return unless record new( id: safe_get(record, config.current_company_id_method)&.to_s ) end |
Instance Method Details
#any? ⇒ 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.
25 26 27 |
# File 'lib/atatus/context/company.rb', line 25 def any? !empty? end |
#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.
21 22 23 |
# File 'lib/atatus/context/company.rb', line 21 def empty? !id end |