Class: BloodContracts::Core::Anything

Inherits:
Refined
  • Object
show all
Defined in:
lib/blood_contracts/core/anything.rb

Overview

Refinement type which represents data which is always correct

Instance Attribute Summary

Attributes inherited from Refined

#context, #errors

Instance Method Summary collapse

Methods inherited from Refined

===, and_then, call, inherited, #initialize, #invalid?, match, or_a, #unpack

Constructor Details

This class inherits a constructor from BloodContracts::Core::Refined

Instance Method Details

#matchBC::Refined

The type which is the result of data matching process (for Anything is always self)

Returns:



9
10
11
# File 'lib/blood_contracts/core/anything.rb', line 9

def match
  self
end

#valid?Boolean

Checks whether the data matches the expectations or not (for Anything is always true)

Returns:

  • (Boolean)


18
19
20
# File 'lib/blood_contracts/core/anything.rb', line 18

def valid?
  true
end