Module: ZmeygoSync

Defined in:
lib/zmeygo_sync/base.rb,
lib/zmeygo_sync/cache.rb,
lib/zmeygo_sync/client.rb,
lib/zmeygo_sync/command.rb,
lib/zmeygo_sync/version.rb,
lib/zmeygo_sync/configuration.rb

Defined Under Namespace

Classes: Cache, Client, Command, Configuration

Constant Summary collapse

VERSION =
"0.21"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.cacheObject

Returns the value of attribute cache.



22
23
24
# File 'lib/zmeygo_sync/base.rb', line 22

def cache
  @cache
end

.clientObject

Returns the value of attribute client.



20
21
22
# File 'lib/zmeygo_sync/base.rb', line 20

def client
  @client
end

.configObject

Returns the value of attribute config.



21
22
23
# File 'lib/zmeygo_sync/base.rb', line 21

def config
  @config
end

.loggerObject

Returns the value of attribute logger.



23
24
25
# File 'lib/zmeygo_sync/base.rb', line 23

def logger
  @logger
end

Class Method Details

.configureObject



29
30
31
32
33
34
35
36
# File 'lib/zmeygo_sync/base.rb', line 29

def configure
  self.config ||= Configuration.new
  if block_given?
    yield(config)
  end
  self.cache = Cache.new
  self.logger = Logger.new(File.join(Rails.root, 'log', 'zmeygo_sync.log'))
end

.method_missing(method, *args) ⇒ Object



25
26
27
# File 'lib/zmeygo_sync/base.rb', line 25

def method_missing(method, *args)
  self.cache.respond_to?(method)? cache.send(method, *args) : super
end