PageLock (Module)

In: app/models/page_lock.rb

Contains all the lock methods to be mixed in with the page

Methods

Constants

LOCKING_PERIOD = 30 * 60

Public Instance methods

[Source]

   # File app/models/page_lock.rb, line 5
5:   def lock(time, locked_by)
6:     @locked_at, @locked_by = time, locked_by
7:   end

[Source]

    # File app/models/page_lock.rb, line 9
 9:   def lock_duration(time)
10:     ((time - @locked_at) / 60).to_i unless @locked_at.nil?
11:   end

[Source]

    # File app/models/page_lock.rb, line 17
17:   def locked?(comparison_time)
18:     @locked_at + LOCKING_PERIOD > comparison_time unless @locked_at.nil?
19:   end

[Source]

    # File app/models/page_lock.rb, line 21
21:   def locked_by_link
22:     web.make_link(@locked_by)
23:   end

[Source]

    # File app/models/page_lock.rb, line 13
13:   def unlock
14:     @locked_at = nil
15:   end

[Validate]