class CalInvite::Configuration
Attributes
Public Class Methods
Source
# File lib/cal_invite/configuration.rb 17 def initialize 18 @cache_store = nil 19 @cache_prefix = 'cal_invite' 20 @cache_expires_in = 24.hours # now this will work with active_support loaded 21 @webhook_secret = nil 22 @timezone = 'UTC' 23 end
Initializes a new Configuration instance with default values.
Public Instance Methods
Source
# File lib/cal_invite/configuration.rb 59 def cache_expires_in=(duration) 60 @cache_expires_in = duration.to_i 61 end
Sets the default cache expiration time.
@param duration [#to_i] The duration in seconds
Source
# File lib/cal_invite/configuration.rb 52 def cache_prefix=(prefix) 53 @cache_prefix = prefix.to_s 54 end
Sets the prefix used for cache keys.
@param prefix [#to_s] The prefix to use for cache keys
Source
# File lib/cal_invite/configuration.rb 32 def cache_store=(store) 33 @cache_store = case store 34 when :memory_store 35 ActiveSupport::Cache::MemoryStore.new 36 when :null_store 37 ActiveSupport::Cache::NullStore.new 38 when Symbol 39 raise ArgumentError, "Unsupported cache store: #{store}" 40 else 41 # Allow custom cache store objects that respond to read/write/delete 42 unless store.respond_to?(:read) && store.respond_to?(:write) && store.respond_to?(:delete) 43 raise ArgumentError, "Custom cache store must implement read/write/delete methods" 44 end 45 store 46 end 47 end
Sets the cache store to use for caching calendar URLs.
@param store [Symbol, #read, #write, #delete] The cache store to use @raise [ArgumentError] If an unsupported cache store is provided
@example Set memory store config.cache_store = :memory_store
Source
# File lib/cal_invite/configuration.rb 73 def timezone=(tz) 74 @timezone = tz.to_s 75 end
Sets the default timezone for events.
@param tz [#to_s] The timezone identifier
Source
# File lib/cal_invite/configuration.rb 66 def webhook_secret=(secret) 67 @webhook_secret = secret 68 end
Sets the webhook secret for verification.
@param secret [String, nil] The secret key