Module: Consyncful

Defined in:
lib/consyncful.rb,
lib/consyncful/base.rb,
lib/consyncful/sync.rb,
lib/consyncful/stats.rb,
lib/consyncful/version.rb,
lib/consyncful/item_mapper.rb

Defined Under Namespace

Classes: Base, Configuration, ItemMapper, Railtie, Stats, Sync

Constant Summary collapse

DEFAULT_CLIENT_OPTIONS =
{
  reuse_entries: true,
  api_url: 'cdn.contentful.com'
}.freeze
VERSION =
'0.3.3'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject

Returns the value of attribute configuration.



15
16
17
# File 'lib/consyncful.rb', line 15

def configuration
  @configuration
end

Class Method Details

.clientObject



39
40
41
42
43
44
45
# File 'lib/consyncful.rb', line 39

def self.client
  @client ||= begin
    options = Consyncful.configuration.contentful_client_options
    options.reverse_merge!(DEFAULT_CLIENT_OPTIONS)
    Contentful::Client.new(options)
  end
end

.configure {|configuration| ... } ⇒ Object

Yields:



18
19
20
21
# File 'lib/consyncful.rb', line 18

def self.configure
  self.configuration ||= Configuration.new
  yield(configuration)
end