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.
23 24 25 26 |
# File 'lib/rollbar-api/project.rb', line 23 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.
22 23 24 |
# File 'lib/rollbar-api/project.rb', line 22 def access_token @access_token end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
22 23 24 |
# File 'lib/rollbar-api/project.rb', line 22 def name @name end |
Class Method Details
.all ⇒ Object
14 15 16 |
# File 'lib/rollbar-api/project.rb', line 14 def self.all @@projects.map { |project_name, _| find(project_name) } end |
.configure(project_name, project_access_token) ⇒ Object
5 6 7 |
# File 'lib/rollbar-api/project.rb', line 5 def self.configure(project_name, project_access_token) @@projects[project_name] = project_access_token end |
.delete_all ⇒ Object
18 19 20 |
# File 'lib/rollbar-api/project.rb', line 18 def self.delete_all @@projects = {} end |
.find(project_name) ⇒ Object
9 10 11 12 |
# File 'lib/rollbar-api/project.rb', line 9 def self.find(project_name) project_access_token = @@projects[project_name] new(project_name, project_access_token) if project_access_token.present? end |