class ContentfulModel::Configuration

Configuration store for ContentfulModel

Attributes

access_token[RW]
default_locale[RW]
entry_mapping[RW]
environment[RW]
management_token[RW]
preview_access_token[RW]
space[RW]

Public Class Methods

new() click to toggle source
# File lib/contentful_model.rb, line 35
def initialize
  @entry_mapping ||= {}
  @environment = 'master'
  @integration_name = 'contentful_model'
  @integration_version = ::ContentfulModel::VERSION
end

Public Instance Methods

options=(options) click to toggle source

Rather than listing out all the possible attributes as setters, we have a catchall called 'options' which takes a hash and generates instance vars @param options [Hash]

# File lib/contentful_model.rb, line 45
def options=(options)
  options.each do |k, v|
    instance_variable_set(:"@#{k}", v)
  end
end
to_hash() click to toggle source

Return the Configuration object as a hash, with symbols as keys. @return [Hash]

# File lib/contentful_model.rb, line 53
def to_hash
  Hash[instance_variables.map { |name| [name.to_s.delete('@').to_sym, instance_variable_get(name)] }]
end