Class: Consyncful::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/consyncful/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



16
17
18
19
20
21
22
23
24
25
# File 'lib/consyncful/configuration.rb', line 16

def initialize
  @contentful_client_options = {}
  @contentful_sync_options = {}
  @locale = 'en-NZ'
  @mongo_client = :default
  @mongo_collection = 'contentful_models'
  @content_tags = []
  @ignore_content_tags = []
  @preserve_contentful_timestamps = false
end

Instance Attribute Details

#content_tagsObject

Returns the value of attribute content_tags.



7
8
9
# File 'lib/consyncful/configuration.rb', line 7

def 
  @content_tags
end

#contentful_client_optionsObject

Returns the value of attribute contentful_client_options.



7
8
9
# File 'lib/consyncful/configuration.rb', line 7

def contentful_client_options
  @contentful_client_options
end

#contentful_sync_optionsObject

Returns the value of attribute contentful_sync_options.



7
8
9
# File 'lib/consyncful/configuration.rb', line 7

def contentful_sync_options
  @contentful_sync_options
end

#ignore_content_tagsObject

Returns the value of attribute ignore_content_tags.



7
8
9
# File 'lib/consyncful/configuration.rb', line 7

def 
  @ignore_content_tags
end

#localeObject

Returns the value of attribute locale.



7
8
9
# File 'lib/consyncful/configuration.rb', line 7

def locale
  @locale
end

#mongo_clientObject

Returns the value of attribute mongo_client.



7
8
9
# File 'lib/consyncful/configuration.rb', line 7

def mongo_client
  @mongo_client
end

#mongo_collectionObject

Returns the value of attribute mongo_collection.



7
8
9
# File 'lib/consyncful/configuration.rb', line 7

def mongo_collection
  @mongo_collection
end

#preserve_contentful_timestampsObject

Returns the value of attribute preserve_contentful_timestamps.



7
8
9
# File 'lib/consyncful/configuration.rb', line 7

def preserve_contentful_timestamps
  @preserve_contentful_timestamps
end

Instance Method Details

#client_optionsObject



33
34
35
36
# File 'lib/consyncful/configuration.rb', line 33

def client_options
  options = @contentful_client_options
  options.reverse_merge!(DEFAULT_CLIENT_OPTIONS)
end

#initial_sync_optionsObject



27
28
29
30
31
# File 'lib/consyncful/configuration.rb', line 27

def initial_sync_options
  options = { initial: true }
  options = options.reverse_merge(@contentful_sync_options)
  options.reverse_merge(DEFAULT_SYNC_OPTIONS)
end