Class: Gitlab::Current::Organization
- Inherits:
-
Object
- Object
- Gitlab::Current::Organization
- Defined in:
- lib/gitlab/current/organization.rb
Constant Summary collapse
- HTTP_HEADER =
'X-GitLab-Organization-ID'
Instance Attribute Summary collapse
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(params: {}, headers: nil, user: nil) ⇒ Organization
constructor
A new instance of Organization.
- #organization ⇒ Object
Constructor Details
#initialize(params: {}, headers: nil, user: nil) ⇒ Organization
Returns a new instance of Organization.
10 11 12 13 14 |
# File 'lib/gitlab/current/organization.rb', line 10 def initialize(params: {}, headers: nil, user: nil) @params = params @user = user @headers = headers end |
Instance Attribute Details
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
6 7 8 |
# File 'lib/gitlab/current/organization.rb', line 6 def headers @headers end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
6 7 8 |
# File 'lib/gitlab/current/organization.rb', line 6 def params @params end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
6 7 8 |
# File 'lib/gitlab/current/organization.rb', line 6 def user @user end |
Instance Method Details
#organization ⇒ Object
16 17 18 |
# File 'lib/gitlab/current/organization.rb', line 16 def organization from_params || from_headers || from_user || fallback_organization end |