Module: CrossStub::Arguments

Defined in:
lib/cross-stub/arguments.rb,
lib/cross-stub/arguments/hash.rb,
lib/cross-stub/arguments/proc.rb,
lib/cross-stub/arguments/array.rb

Overview

:nodoc:

Defined Under Namespace

Modules: Array, Hash, Proc

Class Method Summary collapse

Class Method Details

.parse(args, &block) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/cross-stub/arguments.rb', line 9

def parse(args, &block)
  (
    case args[0]
    when ::Hash then Hash.parse(args[0])
    when ::Symbol then Array.parse(args)
    else {}
    end
  ).merge(block_given? ? Proc.parse(&block) : {})
end