Sha256: dba55ad987162b4af0c074a797710691fb8ad5128d39ce1784dae37d07dedb59
Contents?: true
Size: 909 Bytes
Versions: 5
Compression:
Stored size: 909 Bytes
Contents
# frozen_string_literal: true require 'consyncful/version' require 'mongoid' require 'contentful' require 'consyncful/base' require 'consyncful/sync' require 'consyncful/railtie' if defined?(Rails) module Consyncful class << self attr_accessor :configuration end def self.configure self.configuration ||= Configuration.new yield(configuration) end class Configuration attr_accessor :contentful_client_options, :locale def initialize @contentful_client_options = { api_url: 'cdn.contentful.com' } @locale = 'en-US' end end DEFAULT_CLIENT_OPTIONS = { reuse_entries: true, api_url: 'cdn.contentful.com' }.freeze def self.client @client ||= begin options = Consyncful.configuration.contentful_client_options options.reverse_merge!(DEFAULT_CLIENT_OPTIONS) Contentful::Client.new(options) end end end
Version data entries
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
consyncful-0.4.0 | lib/consyncful.rb |
consyncful-0.3.3 | lib/consyncful.rb |
consyncful-0.3.2 | lib/consyncful.rb |
consyncful-0.3.1 | lib/consyncful.rb |
consyncful-0.3.0 | lib/consyncful.rb |