Class: Method

Inherits:
Object show all
Defined in:
lib/qed/doubles/spy.rb

Instance Method Summary collapse

Instance Method Details

#signature(detail = nil) ⇒ Object

Outputs signiture information.



122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/qed/doubles/spy.rb', line 122

def signature(detail=nil)
  ds = []
  case detail
  when :complete, :all, :full
    ds = migration
  when :class, :with_class
    migration.each { |dh| ds << dh.ducks }
  when :pp, :pretty, :prettyprint, :pretty_print
    migration.each do |dh|
      responders = []
      dh.ducks.each do |responder, argss|
        argss.each { |args| responders << "#{responder}( #{args.join(',')} )" }
      end
      ds << responders
    end
  else
    migration.each { |dh| ds << dh.ducks.keys }
  end
  return ds
end