Class: Errgonomic::Option::None

Inherits:
Any show all
Defined in:
lib/errgonomic/option.rb,
lib/errgonomic/rails/active_record_optional.rb

Overview

A None answers nil? like nil itself, so ActiveRecord internals that check for nil treat an absent value as absent.

Constant Summary

Constants inherited from Any

Any::RUST_SPELLINGS

Instance Method Summary collapse

Methods inherited from Any

#<=>, #==, #and, #and_then, #blank?, #deconstruct, #eql?, #expect!, #filter, #flatten, #hash, #map, #map_or, #map_or_else, #method_missing, #none_or, #ok, #ok_or, #ok_or_else, #or, #or_else, #present?, #pretty_print, #respond_to_missing?, #some_and, #tap_some, #to_a, #to_json, #to_s, #unwrap!, #unwrap_or, #unwrap_or_else, #xor, #zip, #zip_with

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Errgonomic::Option::Any

Instance Method Details

#inspectObject

Examples:

None().inspect # => "None"


551
552
553
# File 'lib/errgonomic/option.rb', line 551

def inspect
  'None'
end

#nil?Boolean

Returns:

  • (Boolean)


85
86
87
# File 'lib/errgonomic/rails/active_record_optional.rb', line 85

def nil?
  true
end

#none?Boolean

Returns:

  • (Boolean)


545
546
547
# File 'lib/errgonomic/option.rb', line 545

def none?
  true
end

#some?Boolean

Returns:

  • (Boolean)


541
542
543
# File 'lib/errgonomic/option.rb', line 541

def some?
  false
end