Class: RollbarApi::Project
- Inherits:
-
Object
- Object
- RollbarApi::Project
- Defined in:
- lib/rollbar-api/project.rb
Constant Summary collapse
- @@projects =
{}
Instance Attribute Summary collapse
-
#access_token ⇒ Object
readonly
Returns the value of attribute access_token.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
- .all ⇒ Object
- .configure(project_name, project_access_token) ⇒ Object
- .delete_all ⇒ Object
- .find(project_name) ⇒ Object
Instance Method Summary collapse
-
#initialize(name, access_token) ⇒ Project
constructor
A new instance of Project.
Constructor Details
#initialize(name, access_token) ⇒ Project
Returns a new instance of Project.
24 25 26 27 |
# File 'lib/rollbar-api/project.rb', line 24 def initialize(name, access_token) @name = name @access_token = access_token end |
Instance Attribute Details
#access_token ⇒ Object (readonly)
Returns the value of attribute access_token.
23 24 25 |
# File 'lib/rollbar-api/project.rb', line 23 def access_token @access_token end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
23 24 25 |
# File 'lib/rollbar-api/project.rb', line 23 def name @name end |
Class Method Details
.all ⇒ Object
15 16 17 |
# File 'lib/rollbar-api/project.rb', line 15 def self.all @@projects.map { |project_name, _| find(project_name) } end |
.configure(project_name, project_access_token) ⇒ Object
5 6 7 8 |
# File 'lib/rollbar-api/project.rb', line 5 def self.configure(project_name, project_access_token) @@projects[project_name] = project_access_token find(project_name) end |
.delete_all ⇒ Object
19 20 21 |
# File 'lib/rollbar-api/project.rb', line 19 def self.delete_all @@projects = {} end |
.find(project_name) ⇒ Object
10 11 12 13 |
# File 'lib/rollbar-api/project.rb', line 10 def self.find(project_name) project_access_token = @@projects[project_name] new(project_name, project_access_token) if project_access_token.present? end |