Module: Assertion::DSL::Caller

Included in:
Base, Guard, Inverter
Defined in:
lib/assertion/dsl/caller.rb

Overview

Allows to initialize and call objects at once

Instance Method Summary collapse

Instance Method Details

#[](*args) ⇒ Object

Initializes and immediately calls the instance of the class

Parameters:

  • args (Object, Array<Object>)

    The <list of> arguments to initialize the instance with

Returns:

  • (Object)

    the result of #call method



18
19
20
# File 'lib/assertion/dsl/caller.rb', line 18

def [](*args)
  new(*args).call
end