File: makes_substitute_methods.rb

package info (click to toggle)
ruby-bogus 0.1.6-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, stretch
  • size: 856 kB
  • ctags: 640
  • sloc: ruby: 4,219; makefile: 7; sh: 2
file content (15 lines) | stat: -rw-r--r-- 351 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module Bogus
  class MakesSubstituteMethods
    extend Takes

    takes :method_stringifier

    def stringify(method)
      args = method_stringifier.argument_values(method.parameters)

      send_args = [method.name.inspect, args].reject(&:empty?).join(', ')

      method_stringifier.stringify(method, "__record__(#{send_args})")
    end
  end
end