Class: SafeType::Boolean

Inherits:
Rule
  • Object
show all
Defined in:
lib/safe_type/primitive/boolean.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Rule

#after, #before, #coerce, coerce, #is_valid?, strict

Constructor Details

#initialize(type: ::SafeType::BooleanMixin, **args) ⇒ Boolean

Returns a new instance of Boolean.



5
6
7
# File 'lib/safe_type/primitive/boolean.rb', line 5

def initialize(type: ::SafeType::BooleanMixin, **args)
  super
end

Class Method Details

.default(value = false) ⇒ Object



9
10
11
# File 'lib/safe_type/primitive/boolean.rb', line 9

def self.default(value=false)
  new(default: value)
end