Method: Fast::Shortcut#run

Defined in:
lib/fast/shortcut.rb

#runHash<String, Array<Astrolabe::Node>] with file => search results.

If the shortcut was defined with a single block and no extra arguments, it only runs the block and return the result of the yielded block. The block is also executed in the [Fast] module level. Making it easy to implement smalls scripts using several Fast methods. Use ARGV to catch regular arguments from command line if the block is given.

Returns:

  • (Hash<String, Array<Astrolabe::Node>] with file => search results.)

    Hash<String, Array<Astrolabe::Node>] with file => search results.



82
83
84
# File 'lib/fast/shortcut.rb', line 82

def run
  Fast.instance_exec(&@block) if single_run_with_block?
end