Class: RenuoCmsRails::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/renuo_cms_rails/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



26
27
28
29
30
31
# File 'lib/renuo_cms_rails/config.rb', line 26

def initialize
  self.api_host = ENV['RENUO_CMS_API_HOST']
  self.api_key = ENV['RENUO_CMS_API_KEY']
  self.private_api_key = ENV['RENUO_CMS_PRIVATE_API_KEY']
  self.content_path_generator = ->(path) { "#{path}-#{I18n.locale}" }
end

Instance Attribute Details

#api_host=(value) ⇒ Object

Sets the attribute api_host

Parameters:

  • value

    the value to set the attribute api_host to.



19
20
21
# File 'lib/renuo_cms_rails/config.rb', line 19

def api_host=(value)
  @api_host = value
end

#api_keyObject

Returns the value of attribute api_key.



22
23
24
# File 'lib/renuo_cms_rails/config.rb', line 22

def api_key
  @api_key
end

#content_path_generatorObject

Returns the value of attribute content_path_generator.



24
25
26
# File 'lib/renuo_cms_rails/config.rb', line 24

def content_path_generator
  @content_path_generator
end

#private_api_keyObject

Returns the value of attribute private_api_key.



23
24
25
# File 'lib/renuo_cms_rails/config.rb', line 23

def private_api_key
  @private_api_key
end

Instance Method Details

#api_host_with_protocolObject



33
34
35
36
37
# File 'lib/renuo_cms_rails/config.rb', line 33

def api_host_with_protocol
  host = api_host
  return host if host.start_with?('https://', 'http://', '//')
  "https://#{host}"
end