Class: Grumblr::Core

Inherits:
Object
  • Object
show all
Defined in:
lib/grumblr/core.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCore

Returns a new instance of Core.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/grumblr/core.rb', line 13

def initialize
  $app = self

  $cfg = Grumblr::Config.new

  $gui = Grumblr::UI.new
  $gui.show_all

  $api = Ppds::Tumblr.new
  if $api.authenticate($cfg.get(:email), $cfg.get(:password))
    $gui.add Grumblr::Dashboard.new
  else
    $gui.add Grumblr::SettingsFrame.new
  end
end

Instance Attribute Details

#blogObject

Returns the value of attribute blog.



11
12
13
# File 'lib/grumblr/core.rb', line 11

def blog
  @blog
end

Instance Method Details

#mainObject



29
30
31
# File 'lib/grumblr/core.rb', line 29

def main
  Gtk::main
end

#quitObject



33
34
35
36
37
# File 'lib/grumblr/core.rb', line 33

def quit
  Gtk::main_quit
ensure
  $cfg.save
end