Sha256: 34eafce7f32297e8e9d98ff9608e31eec548306dadae76de90b09f1c1dad6d07

Contents?: true

Size: 649 Bytes

Versions: 3

Compression:

Stored size: 649 Bytes

Contents

# frozen_string_literal: true

# Locker subsystem
module Locker
  # Misc helpers
  module Misc
    def user_locks(user)
      owned = []
      Locker::Label::Label.list.each do |name|
        label = Locker::Label::Label.new(name)
        owned.push(name) if label.owner == user
      end
      owned
    end

    def success(message)
      render_template('success', string: message)
    end

    def failed(message)
      render_template('failed', string: message)
    end

    def locked(message)
      render_template('lock', string: message)
    end

    def unlocked(message)
      render_template('unlock', string: message)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
lita-locker-1.2.0 lib/locker/misc.rb
lita-locker-1.1.1 lib/locker/misc.rb
lita-locker-1.1.0 lib/locker/misc.rb