Class: Quack::Types::Boolean

Inherits:
Quack::Type show all
Defined in:
lib/quack/types/boolean.rb

Instance Attribute Summary

Attributes inherited from Quack::Type

#value

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Quack::Type

already_coerced?, #already_coerced?, built_in_types, #initialize, #to_s, #type_matches?

Constructor Details

This class inherits a constructor from Quack::Type

Class Method Details

.matches?(value) ⇒ Boolean

Returns:



7
8
9
# File 'lib/quack/types/boolean.rb', line 7

def matches?(value)
  value.to_s == "true" || value.to_s == "false"
end

Instance Method Details

#to_coercedObject



12
13
14
# File 'lib/quack/types/boolean.rb', line 12

def to_coerced
  value.to_s == "true"
end