module Noodles

Constants

VERSION

Attributes

cache_store_name[RW]
use_memached_as_session_storage[RW]

Public Class Methods

application() click to toggle source
# File lib/noodles.rb, line 15
def application
  return @@application if defined? @@application
  @@application = Noodles::Application.new
end
cache() click to toggle source
# File lib/noodles.rb, line 40
def cache
 return @@cache if defined? @@cache
 namespace = cache_store_name || 'noodle_app'
 options = { namespace: namespace, compress: true }
 @@cache = Cache.new('localhost:11211', options)
end
env() click to toggle source
# File lib/noodles.rb, line 11
def env
  Environment
end
http_app() click to toggle source
# File lib/noodles.rb, line 20
def http_app
  return @@http_app if defined? @@http_app
  @@http_app = application.http_app
end
secrets() click to toggle source
# File lib/noodles.rb, line 30
def secrets
  rendered_string = Erubis::Eruby.new(File.read(secrets_path)).result
  secrets_hash = YAML.load(rendered_string)[Noodles.env.to_s]
  OpenStruct.new(secrets_hash)
end
secrets_path() click to toggle source
# File lib/noodles.rb, line 36
def secrets_path
  File.join('config', 'secrets.yml')
end
setup() { |self| ... } click to toggle source
# File lib/noodles.rb, line 47
def setup
  yield self
end
to_underscore(string) click to toggle source
# File lib/noodles/utils.rb, line 2
def self.to_underscore(string)
  string.gsub(/::/, '/').
  gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
  gsub(/([a-z\d])([A-Z])/,'\1_\2').
  tr("-", "_").downcase
end
websocket_app() click to toggle source
# File lib/noodles.rb, line 25
def websocket_app
  return @@websocket_app if defined? @@websocket_app
  @@websocket_app = application.websocket_app
end