Class: Project

Inherits:
Object
  • Object
show all
Defined in:
lib/airbrake/cli/project.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

Parameters:

  • value

    the value to set the attribute api_key to.



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

Parameters:

  • value

    the value to set the attribute id to.



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

Parameters:

  • value

    the value to set the attribute name to.



2
3
4
# File 'lib/airbrake/cli/project.rb', line 2

def name=(value)
  @name = value
end

Instance Method Details

#to_sObject



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

Returns:

  • (Boolean)


14
15
16
# File 'lib/airbrake/cli/project.rb', line 14

def valid?
  @name && @id && @api_key
end