Methods
- C
- D
- N
- V
Class Public methods
new(args = {}) Link
Source: show
# File app/actions/action/drip_access_manager.rb, line 3 def initialize(args = {}) @viewable = args.fetch(:viewable) @member = args.fetch(:member) @now = args.fetch(:now, Time.zone.now).to_i @seconds_until_viewable = nil @can_view = false end
Instance Public methods
can_view?() Link
Source: show
# File app/actions/action/drip_access_manager.rb, line 11 def can_view? return true if is_site_owner return false if outside_period? return true unless @viewable.days_until_drip ask_plannings_for_access if @member @can_view end
days_until_viewable() Link
Source: show
# File app/actions/action/drip_access_manager.rb, line 20 def days_until_viewable @seconds_until_viewable / 86_400 if @seconds_until_viewable end