Class: Consyncful::Configuration
- Inherits:
-
Object
- Object
- Consyncful::Configuration
- Defined in:
- lib/consyncful/configuration.rb
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.
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_tags ⇒ Object
Returns the value of attribute content_tags.
7 8 9 |
# File 'lib/consyncful/configuration.rb', line 7 def @content_tags end |
#contentful_client_options ⇒ Object
Returns the value of attribute contentful_client_options.
7 8 9 |
# File 'lib/consyncful/configuration.rb', line 7 def @contentful_client_options end |
#contentful_sync_options ⇒ Object
Returns the value of attribute contentful_sync_options.
7 8 9 |
# File 'lib/consyncful/configuration.rb', line 7 def @contentful_sync_options end |
#ignore_content_tags ⇒ Object
Returns the value of attribute ignore_content_tags.
7 8 9 |
# File 'lib/consyncful/configuration.rb', line 7 def @ignore_content_tags end |
#locale ⇒ Object
Returns the value of attribute locale.
7 8 9 |
# File 'lib/consyncful/configuration.rb', line 7 def locale @locale end |
#mongo_client ⇒ Object
Returns the value of attribute mongo_client.
7 8 9 |
# File 'lib/consyncful/configuration.rb', line 7 def mongo_client @mongo_client end |
#mongo_collection ⇒ Object
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_timestamps ⇒ Object
Returns the value of attribute preserve_contentful_timestamps.
7 8 9 |
# File 'lib/consyncful/configuration.rb', line 7 def @preserve_contentful_timestamps end |
Instance Method Details
#client_options ⇒ Object
33 34 35 36 |
# File 'lib/consyncful/configuration.rb', line 33 def = @contentful_client_options .reverse_merge!(DEFAULT_CLIENT_OPTIONS) end |
#initial_sync_options ⇒ Object
27 28 29 30 31 |
# File 'lib/consyncful/configuration.rb', line 27 def = { initial: true } = .reverse_merge(@contentful_sync_options) .reverse_merge(DEFAULT_SYNC_OPTIONS) end |