Class: MediumToWebflow::Config
- Inherits:
-
Object
- Object
- MediumToWebflow::Config
- Defined in:
- lib/medium_to_webflow/config.rb
Constant Summary collapse
- REQUIRED_WEBFLOW_FIELDS =
%w[name slug].freeze
- REQUIRED_SETTINGS =
%i[medium_username webflow_api_token webflow_collection_id].freeze
Instance Attribute Summary collapse
-
#field_mappings ⇒ Object
Returns the value of attribute field_mappings.
-
#force_update ⇒ Object
Returns the value of attribute force_update.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#medium_username ⇒ Object
Returns the value of attribute medium_username.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
-
#webflow_api_token ⇒ Object
Returns the value of attribute webflow_api_token.
-
#webflow_collection_id ⇒ Object
Returns the value of attribute webflow_collection_id.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #to_h ⇒ Object
- #validate! ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
14 15 16 17 18 19 |
# File 'lib/medium_to_webflow/config.rb', line 14 def initialize @logger = Logger.new($stdout) @logger.level = Logger::INFO @verbose = false @force_update = false end |
Instance Attribute Details
#field_mappings ⇒ Object
Returns the value of attribute field_mappings.
10 11 12 |
# File 'lib/medium_to_webflow/config.rb', line 10 def field_mappings @field_mappings end |
#force_update ⇒ Object
Returns the value of attribute force_update.
10 11 12 |
# File 'lib/medium_to_webflow/config.rb', line 10 def force_update @force_update end |
#logger ⇒ Object
Returns the value of attribute logger.
10 11 12 |
# File 'lib/medium_to_webflow/config.rb', line 10 def logger @logger end |
#medium_username ⇒ Object
Returns the value of attribute medium_username.
10 11 12 |
# File 'lib/medium_to_webflow/config.rb', line 10 def medium_username @medium_username end |
#verbose ⇒ Object
Returns the value of attribute verbose.
12 13 14 |
# File 'lib/medium_to_webflow/config.rb', line 12 def verbose @verbose end |
#webflow_api_token ⇒ Object
Returns the value of attribute webflow_api_token.
10 11 12 |
# File 'lib/medium_to_webflow/config.rb', line 10 def webflow_api_token @webflow_api_token end |
#webflow_collection_id ⇒ Object
Returns the value of attribute webflow_collection_id.
10 11 12 |
# File 'lib/medium_to_webflow/config.rb', line 10 def webflow_collection_id @webflow_collection_id end |
Instance Method Details
#to_h ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/medium_to_webflow/config.rb', line 31 def to_h { medium_username: medium_username, webflow_api_token: webflow_api_token, webflow_collection_id: webflow_collection_id, field_mappings: field_mappings } end |
#validate! ⇒ Object
26 27 28 29 |
# File 'lib/medium_to_webflow/config.rb', line 26 def validate! validate_required_settings! validate_required_field_mappings! end |