summaryrefslogtreecommitdiffhomepage
path: root/signatures.rb
blob: 78276079ae5afe9108df121be80f0492f5e2a26d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
class FelFlame
  class Signature
    class <<self
      def next_signature
        @next_signature ||= 1
      end

      def next_signature= num
        @next_signature = num
      end

      def create_new_signature(name)
        temp = self.next_signature
        self.next_signature = 2 * self.next_signature
        define_singleton_method(name) do
          temp
        end
        send(name)
      end
    end
  end
end