Class: RailsConnector::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_connector/configuration.rb

Constant Summary collapse

DEFAULT_MODE =
:live

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.blob_cache_dirObject

define a non-default blob cache dir. fiona connector only. has no effect when used with the cloud connector.



35
36
37
# File 'lib/rails_connector/configuration.rb', line 35

def blob_cache_dir
  @blob_cache_dir
end

.modeObject

there are three available modes for the rails connector: live (show released contents only), preview (show edited contents) editor (show edited contents and editor interface (e.g. edit markers)) Default mode is live.



20
21
22
# File 'lib/rails_connector/configuration.rb', line 20

def mode
  @mode
end

.search_optionsObject

default options for SearchRequest



28
29
30
# File 'lib/rails_connector/configuration.rb', line 28

def search_options
  @search_options || local_config_file["search"].symbolize_keys
end

Class Method Details

.choose_homepage(&block) ⇒ Object

Configure a callback to be invoked when the rails connector delivers the homepage. The given callback will receive the rack env and must return an Obj to be used as the homepage. If no callback is configured, Obj.homepage will be used as the default.



99
100
101
# File 'lib/rails_connector/configuration.rb', line 99

def choose_homepage(&block)
  self.choose_homepage_callback = block
end

.instance_name=(name) ⇒ Object

Configures your CMS instance name.

Example call as to be used in rails_connector.rb:

RailsConnector::Configuration.instance_name = 'internet'


67
68
69
# File 'lib/rails_connector/configuration.rb', line 67

def instance_name=(name)
  RailsConnector::CmsBaseModel.instance_name = name if RailsConnector.platform_fiona?
end