Module: RocketPants
- Defined in:
- lib/rocket_pants/active_record.rb,
lib/rocket_pants.rb,
lib/rocket_pants/base.rb,
lib/rocket_pants/error.rb,
lib/rocket_pants/client.rb,
lib/rocket_pants/errors.rb,
lib/rocket_pants/railtie.rb,
lib/rocket_pants/routing.rb,
lib/rocket_pants/cacheable.rb,
lib/rocket_pants/test_helper.rb,
lib/rocket_pants/rspec_matchers.rb,
lib/rocket_pants/cache_middleware.rb,
lib/rocket_pants/controller/jsonp.rb,
lib/rocket_pants/controller/caching.rb,
lib/rocket_pants/controller/linking.rb,
lib/rocket_pants/controller/url_for.rb,
lib/rocket_pants/controller/rescuable.rb,
lib/rocket_pants/controller/versioning.rb,
lib/rocket_pants/controller/respondable.rb,
lib/rocket_pants/controller/error_handling.rb,
lib/rocket_pants/controller/header_metadata.rb,
lib/rocket_pants/controller/instrumentation.rb,
lib/rocket_pants/controller/format_verification.rb
Overview
Provides a bunch of default active record integration entry points.
Defined Under Namespace
Modules: ActiveRecordIntegration, Cacheable, Caching, ErrorHandling, FormatVerification, HeaderMetadata, Instrumentation, JSONP, Linking, RSpecMatchers, Rescuable, Respondable, Routing, TestHelper, UrlFor, Versioning
Classes: Base, CacheMiddleware, Client, Error, Errors, InvalidResource, Railtie
Class Method Summary
collapse
Class Method Details
.cache ⇒ Object
53
54
55
|
# File 'lib/rocket_pants.rb', line 53
def cache
@@cache ||= Moneta::Memory.new
end
|
.default_env ⇒ Object
66
67
68
69
70
|
# File 'lib/rocket_pants.rb', line 66
def default_env
env = Rails.env.to_s if defined?(Rails.env)
env ||= ENV['RAILS_ENV'].presence || ENV['RACK_ENV'].presence || "development"
ActiveSupport::StringInquirer.new env
end
|
.default_pass_through_errors ⇒ Object
72
73
74
|
# File 'lib/rocket_pants.rb', line 72
def default_pass_through_errors
env.development? || env.test?
end
|
.env ⇒ Object
57
58
59
|
# File 'lib/rocket_pants.rb', line 57
def env
@@env ||= default_env
end
|
.env=(value) ⇒ Object
61
62
63
64
|
# File 'lib/rocket_pants.rb', line 61
def env=(value)
value = value.presence && ActiveSupport::StringInquirer.new(value)
@@env = value
end
|
.pass_through_errors ⇒ Object
Also known as:
pass_through_errors?
76
77
78
79
80
81
82
|
# File 'lib/rocket_pants.rb', line 76
def pass_through_errors
if defined?(@@pass_through_errors) && [true, false].include?(@@pass_through_errors)
@@pass_through_errors
else
@@pass_through_errors = default_pass_through_errors
end
end
|
.pass_through_errors=(value) ⇒ Object
85
86
87
|
# File 'lib/rocket_pants.rb', line 85
def pass_through_errors=(value)
@@pass_through_errors = value
end
|