Class: Rage::Configuration::Cable
- Inherits:
-
Object
- Object
- Rage::Configuration::Cable
- Defined in:
- lib/rage/configuration.rb
Instance Attribute Summary collapse
-
#allowed_request_origins ⇒ Object
Returns the value of attribute allowed_request_origins.
-
#disable_request_forgery_protection ⇒ Object
Returns the value of attribute disable_request_forgery_protection.
-
#protocol ⇒ Object
Returns the value of attribute protocol.
Instance Method Summary collapse
- #adapter ⇒ Object
- #adapter_config ⇒ Object
- #config ⇒ Object
-
#initialize ⇒ Cable
constructor
A new instance of Cable.
Constructor Details
Instance Attribute Details
#allowed_request_origins ⇒ Object
Returns the value of attribute allowed_request_origins.
260 261 262 |
# File 'lib/rage/configuration.rb', line 260 def allowed_request_origins @allowed_request_origins end |
#disable_request_forgery_protection ⇒ Object
Returns the value of attribute disable_request_forgery_protection.
260 261 262 |
# File 'lib/rage/configuration.rb', line 260 def disable_request_forgery_protection @disable_request_forgery_protection end |
#protocol ⇒ Object
Returns the value of attribute protocol.
260 261 262 |
# File 'lib/rage/configuration.rb', line 260 def protocol @protocol end |
Instance Method Details
#adapter ⇒ Object
301 302 303 304 305 306 |
# File 'lib/rage/configuration.rb', line 301 def adapter case config[:adapter] when "redis" Rage::Cable::Adapters::Redis.new(adapter_config) end end |
#adapter_config ⇒ Object
297 298 299 |
# File 'lib/rage/configuration.rb', line 297 def adapter_config config.except(:adapter) end |
#config ⇒ Object
284 285 286 287 288 289 290 291 292 293 294 295 |
# File 'lib/rage/configuration.rb', line 284 def config @config ||= begin config_file = Rage.root.join("config/cable.yml") if config_file.exist? yaml = ERB.new(config_file.read).result YAML.safe_load(yaml, aliases: true, symbolize_names: true)[Rage.env.to_sym] || {} else {} end end end |