Class: GSquire::Application
- Inherits:
-
Object
- Object
- GSquire::Application
- Defined in:
- lib/gsquire/application.rb
Overview
This is the entry-point class for GSquire. Clients should use it to implement applications that use GSquire.
As of now it is only a simple container used to setup logging and the database directory.
Since GSquire supports multiple accounts by default, this class simply wraps an Accounts instance that is available through the accounts
instance attribute.
Instance Attribute Summary collapse
-
#accounts ⇒ Object
readonly
Accounts instance that holds all authorized Google accounts in the GSquire database stored at
options[:path]
. -
#options ⇒ Object
readonly
Parsed options.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Application
constructor
A new instance of Application.
Constructor Details
#initialize(opts = {}) ⇒ Application
Returns a new instance of Application.
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/gsquire/application.rb', line 24 def initialize(opts = {}) @options = { :path => File.join(ENV['HOME'], '.gsquire') }.merge(opts) begin FileUtils.mkdir_p [:path] rescue abort "Error creating GSquire database directory: #{$!}" end @accounts = Accounts.new :path => [:path], :logger => logger end |
Instance Attribute Details
#accounts ⇒ Object (readonly)
GSquire::Accounts instance that holds all authorized Google accounts in the GSquire database stored at options[:path]
.
18 19 20 |
# File 'lib/gsquire/application.rb', line 18 def accounts @accounts end |
#options ⇒ Object (readonly)
Parsed options.
20 21 22 |
# File 'lib/gsquire/application.rb', line 20 def @options end |