Class: Cachext::Options
- Inherits:
-
Object
- Object
- Cachext::Options
- Defined in:
- lib/cachext/options.rb
Instance Attribute Summary collapse
-
#default ⇒ Object
readonly
Returns the value of attribute default.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#expires_in ⇒ Object
readonly
Returns the value of attribute expires_in.
-
#heartbeat_expires ⇒ Object
readonly
Returns the value of attribute heartbeat_expires.
-
#not_found_error ⇒ Object
readonly
Returns the value of attribute not_found_error.
-
#reraise_errors ⇒ Object
readonly
Returns the value of attribute reraise_errors.
Instance Method Summary collapse
- #cache? ⇒ Boolean
-
#initialize(config, expires_in: config.default_expires_in, default: nil, errors: config.default_errors, reraise_errors: true, not_found_error: config.not_found_errors, heartbeat_expires: config.heartbeat_expires, cache: true) ⇒ Options
constructor
A new instance of Options.
Constructor Details
#initialize(config, expires_in: config.default_expires_in, default: nil, errors: config.default_errors, reraise_errors: true, not_found_error: config.not_found_errors, heartbeat_expires: config.heartbeat_expires, cache: true) ⇒ Options
Returns a new instance of Options.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/cachext/options.rb', line 11 def initialize config, expires_in: config.default_expires_in, default: nil, errors: config.default_errors, reraise_errors: true, not_found_error: config.not_found_errors, heartbeat_expires: config.heartbeat_expires, cache: true @expires_in = expires_in @default = default @errors = errors @reraise_errors = reraise_errors @not_found_error = not_found_error @heartbeat_expires = heartbeat_expires @cache = cache end |
Instance Attribute Details
#default ⇒ Object (readonly)
Returns the value of attribute default.
4 5 6 |
# File 'lib/cachext/options.rb', line 4 def default @default end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
4 5 6 |
# File 'lib/cachext/options.rb', line 4 def errors @errors end |
#expires_in ⇒ Object (readonly)
Returns the value of attribute expires_in.
4 5 6 |
# File 'lib/cachext/options.rb', line 4 def expires_in @expires_in end |
#heartbeat_expires ⇒ Object (readonly)
Returns the value of attribute heartbeat_expires.
4 5 6 |
# File 'lib/cachext/options.rb', line 4 def heartbeat_expires @heartbeat_expires end |
#not_found_error ⇒ Object (readonly)
Returns the value of attribute not_found_error.
4 5 6 |
# File 'lib/cachext/options.rb', line 4 def not_found_error @not_found_error end |
#reraise_errors ⇒ Object (readonly)
Returns the value of attribute reraise_errors.
4 5 6 |
# File 'lib/cachext/options.rb', line 4 def reraise_errors @reraise_errors end |
Instance Method Details
#cache? ⇒ Boolean
29 30 31 |
# File 'lib/cachext/options.rb', line 29 def cache? @cache end |