Class: GcalMapper::Sync

Inherits:
Object
  • Object
show all
Defined in:
lib/gcal_mapper/sync.rb

Overview

Provide methods to synch google calendar and local bd

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config, base) ⇒ Sync

new Sync object

Parameters:

  • config (Configuration)

    configuration class seted by DSL

  • base (Class)

    class of the calle



19
20
21
22
# File 'lib/gcal_mapper/sync.rb', line 19

def initialize(config, base)
  @config = config
  @base = base
end

Class Method Details

.sync(config, base) ⇒ Object

proxy to call sync methods and set new instance

Parameters:

  • config (Configuration)

    configuration class seted by DSL

  • base (Class)

    class of the caller



11
12
13
# File 'lib/gcal_mapper/sync.rb', line 11

def self.sync(config, base)
  new(config, base).sync_gcal
end

Instance Method Details

#sync_gcalObject

full synchronization step by step



26
27
28
29
30
# File 'lib/gcal_mapper/sync.rb', line 26

def sync_gcal
  authenticate
  fetch_events
  save_events
end