Class: Teckel::None

Inherits:
Object
  • Object
show all
Defined in:
lib/teckel/none.rb

Overview

Simple type object for enforcing input, output or error data to be not set (or nil)

Class Method Summary collapse

Class Method Details

.[](*args) ⇒ Object Also known as: new

Always return nil

Returns:

  • nil

Raises:

  • (ArgumentError)

    when called with any non-nil arguments



11
12
13
# File 'lib/teckel/none.rb', line 11

def [](*args)
  raise ArgumentError, "None called with arguments" if args.any?(&:itself)
end