Class: Consyncful::Configuration
- Inherits:
-
Object
- Object
- Consyncful::Configuration
- Defined in:
- lib/consyncful.rb
Overview
Handles Rails configurations for Consynful
Instance Attribute Summary collapse
-
#content_tags ⇒ Object
Returns the value of attribute content_tags.
-
#contentful_client_options ⇒ Object
Returns the value of attribute contentful_client_options.
-
#contentful_sync_options ⇒ Object
Returns the value of attribute contentful_sync_options.
-
#ignore_content_tags ⇒ Object
Returns the value of attribute ignore_content_tags.
-
#locale ⇒ Object
Returns the value of attribute locale.
-
#mongo_client ⇒ Object
Returns the value of attribute mongo_client.
-
#mongo_collection ⇒ Object
Returns the value of attribute mongo_collection.
-
#preserve_contentful_timestamps ⇒ Object
Returns the value of attribute preserve_contentful_timestamps.
Instance Method Summary collapse
- #client_options ⇒ Object
- #initial_sync_options ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/consyncful.rb', line 22 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_tags ⇒ Object
Returns the value of attribute content_tags.
13 14 15 |
# File 'lib/consyncful.rb', line 13 def @content_tags end |
#contentful_client_options ⇒ Object
Returns the value of attribute contentful_client_options.
13 14 15 |
# File 'lib/consyncful.rb', line 13 def @contentful_client_options end |
#contentful_sync_options ⇒ Object
Returns the value of attribute contentful_sync_options.
13 14 15 |
# File 'lib/consyncful.rb', line 13 def @contentful_sync_options end |
#ignore_content_tags ⇒ Object
Returns the value of attribute ignore_content_tags.
13 14 15 |
# File 'lib/consyncful.rb', line 13 def @ignore_content_tags end |
#locale ⇒ Object
Returns the value of attribute locale.
13 14 15 |
# File 'lib/consyncful.rb', line 13 def locale @locale end |
#mongo_client ⇒ Object
Returns the value of attribute mongo_client.
13 14 15 |
# File 'lib/consyncful.rb', line 13 def mongo_client @mongo_client end |
#mongo_collection ⇒ Object
Returns the value of attribute mongo_collection.
13 14 15 |
# File 'lib/consyncful.rb', line 13 def mongo_collection @mongo_collection end |
#preserve_contentful_timestamps ⇒ Object
Returns the value of attribute preserve_contentful_timestamps.
13 14 15 |
# File 'lib/consyncful.rb', line 13 def @preserve_contentful_timestamps end |
Instance Method Details
#client_options ⇒ Object
39 40 41 42 |
# File 'lib/consyncful.rb', line 39 def = @contentful_client_options .reverse_merge!(DEFAULT_CLIENT_OPTIONS) end |
#initial_sync_options ⇒ Object
33 34 35 36 37 |
# File 'lib/consyncful.rb', line 33 def = { initial: true } = .reverse_merge(@contentful_sync_options) .reverse_merge(DEFAULT_SYNC_OPTIONS) end |