Class: Potter::Types::Boolean

Inherits:
Type
  • Object
show all
Defined in:
lib/potter/types.rb

Instance Attribute Summary

Attributes inherited from Type

#options

Instance Method Summary collapse

Methods inherited from Type

#from, #generate, #initialize, #klass, #name, #new, #to_sym

Methods included from OptionHelpers

#assign_option!, #assign_options!

Constructor Details

This class inherits a constructor from Potter::Types::Type

Instance Method Details

#parse(o) ⇒ Object



36
37
38
39
40
41
42
43
# File 'lib/potter/types.rb', line 36

def parse(o)
  case o
  when /^\s*(|no|off|0+)\s*$/i,
        false, 0, nil
    false
  else true
  end
end