Class: Pushover::App::App
- Inherits:
-
Object
- Object
- Pushover::App::App
- Defined in:
- lib/pushover/app.rb
Overview
an instance of an application.
Instance Attribute Summary collapse
-
#api_key ⇒ String
The api_key of the application.
-
#name ⇒ String
The name of the application.
Instance Method Summary collapse
-
#initialize(api_key, name) ⇒ App
constructor
A new instance of App.
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_key ⇒ String
Returns 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 |
#name ⇒ String
Returns 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 |