Class: Project
- Inherits:
-
Object
- Object
- Project
- Defined in:
- lib/airbrake/cli/project.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
writeonly
Sets the attribute api_key.
-
#id ⇒ Object
writeonly
Sets the attribute id.
-
#name ⇒ Object
writeonly
Sets the attribute name.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Project
constructor
A new instance of Project.
- #to_s ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(attributes = {}) ⇒ Project
Returns a new instance of Project.
4 5 6 7 8 |
# File 'lib/airbrake/cli/project.rb', line 4 def initialize(attributes = {}) attributes.keys.each do |key| instance_variable_set("@#{key}",attributes[key]) end end |
Instance Attribute Details
#api_key=(value) ⇒ Object (writeonly)
Sets the attribute api_key
2 3 4 |
# File 'lib/airbrake/cli/project.rb', line 2 def api_key=(value) @api_key = value end |
#id=(value) ⇒ Object (writeonly)
Sets the attribute id
2 3 4 |
# File 'lib/airbrake/cli/project.rb', line 2 def id=(value) @id = value end |
#name=(value) ⇒ Object (writeonly)
Sets the attribute name
2 3 4 |
# File 'lib/airbrake/cli/project.rb', line 2 def name=(value) @name = value end |
Instance Method Details
#to_s ⇒ Object
10 11 12 |
# File 'lib/airbrake/cli/project.rb', line 10 def to_s "#{@name}".rjust(20) + "(#{@id}):".rjust(10) + " #{@api_key}" end |
#valid? ⇒ Boolean
14 15 16 |
# File 'lib/airbrake/cli/project.rb', line 14 def valid? @name && @id && @api_key end |