Class: Pushover::App::App

Inherits:
Object
  • Object
show all
Defined in:
lib/pushover/app.rb

Overview

an instance of an application.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key, name) ⇒ App

Returns a new instance of App.



13
14
15
16
17
18
19
20
21
22
# File 'lib/pushover/app.rb', line 13

def initialize(api_key, name)
	@name = name
	@api_key = api_key
	Config[:applications] = {} if !Config[:applications]
	if name
		Config[:applications][name] = api_key
	else
		Config[:applications][api_key] = api_key
	end
end

Instance Attribute Details

#api_keyString

Returns the api_key of the application.

Returns:

  • (String)

    the api_key of the application.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/pushover/app.rb', line 9

class App
	attr_accessor :name
	attr_accessor :api_key

	def initialize(api_key, name)
		@name = name
		@api_key = api_key
		Config[:applications] = {} if !Config[:applications]
		if name
			Config[:applications][name] = api_key
		else
			Config[:applications][api_key] = api_key
		end
	end
end

#nameString

Returns the name of the application.

Returns:

  • (String)

    the name of the application.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/pushover/app.rb', line 9

class App
	attr_accessor :name
	attr_accessor :api_key

	def initialize(api_key, name)
		@name = name
		@api_key = api_key
		Config[:applications] = {} if !Config[:applications]
		if name
			Config[:applications][name] = api_key
		else
			Config[:applications][api_key] = api_key
		end
	end
end