File: util.rb

package info (click to toggle)
mikutter 5.0.4%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 9,700 kB
  • sloc: ruby: 21,307; sh: 181; makefile: 19
file content (44 lines) | stat: -rw-r--r-- 770 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
module Plugin::Mastodon
  class Util
    class << self
      def deep_dup(obj)
        Marshal.load(Marshal.dump(obj))
      end

      def ppf(obj)
        pp obj
        $stdout.flush
      end

      def visibility2select(s)
        case s
        when "public"
            :"1public"
        when "unlisted"
            :"2unlisted"
        when "private"
            :"3private"
        when "direct"
            :"4direct"
        else
          nil
        end
      end

      def select2visibility(s)
        case s
        when :"1public"
          "public"
        when :"2unlisted"
          "unlisted"
        when :"3private"
          "private"
        when :"4direct"
          "direct"
        else
          nil
        end
      end
    end
  end
end