Class: ActiveEndpoint::Routes::Cache::Store

Inherits:
Object
  • Object
show all
Defined in:
lib/active_endpoint/routes/cache/store.rb

Instance Method Summary collapse

Constructor Details

#initializeStore

Returns a new instance of Store.



9
10
11
12
13
# File 'lib/active_endpoint/routes/cache/store.rb', line 9

def initialize
  @store = ActiveEndpoint::Routes::Cache::Proxy.build(ActiveEndpoint.cache_store_client)
  @logger = ActiveEndpoint.logger
  @notifier = ActiveSupport::Notifications
end

Instance Method Details

#allow?(rule) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/active_endpoint/routes/cache/store.rb', line 15

def allow?(rule)
  rule_cache_allow?(rule) && storage_cache_allow?(rule)
end

#unregistred?(probe) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
22
# File 'lib/active_endpoint/routes/cache/store.rb', line 19

def unregistred?(probe)
  path = probe[:path]
  read(path).present? ? false : write(path, :unregistred)
end