Class: RollbarApi::Account

Inherits:
Object
  • Object
show all
Defined in:
lib/rollbar-api/account.rb

Constant Summary collapse

@@accounts =
{}

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, access_token) ⇒ Account

Returns a new instance of Account.



24
25
26
27
# File 'lib/rollbar-api/account.rb', line 24

def initialize(name, access_token)
  @name = name
  @access_token = access_token
end

Instance Attribute Details

#access_tokenObject (readonly)

Returns the value of attribute access_token.



23
24
25
# File 'lib/rollbar-api/account.rb', line 23

def access_token
  @access_token
end

#nameObject (readonly)

Returns the value of attribute name.



23
24
25
# File 'lib/rollbar-api/account.rb', line 23

def name
  @name
end

Class Method Details

.allObject



15
16
17
# File 'lib/rollbar-api/account.rb', line 15

def self.all
  @@accounts.map { |, _| find() }
end

.configure(account_name, account_access_token) ⇒ Object



5
6
7
8
# File 'lib/rollbar-api/account.rb', line 5

def self.configure(, )
  @@accounts[] = 
  find()
end

.delete_allObject



19
20
21
# File 'lib/rollbar-api/account.rb', line 19

def self.delete_all
  @@accounts = {}
end

.find(account_name) ⇒ Object



10
11
12
13
# File 'lib/rollbar-api/account.rb', line 10

def self.find()
   = @@accounts[]
  new(, ) if .present?
end