Class: Method

Inherits:
Object show all
Defined in:
lib/carat/duckhunter.rb

Defined Under Namespace

Classes: DuckHunter

Instance Method Summary collapse

Instance Method Details

#signature(detail = nil) ⇒ Object

Outputs signiture information.



136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/carat/duckhunter.rb', line 136

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