Class: Goaltender::ValueParser::Boolean

Inherits:
Goaltender::ValueParser show all
Defined in:
lib/goaltender/value_parser/boolean.rb

Instance Attribute Summary

Attributes inherited from Goaltender::ValueParser

#input_value

Instance Method Summary collapse

Methods inherited from Goaltender::ValueParser

#after_init, #initialize

Constructor Details

This class inherits a constructor from Goaltender::ValueParser

Instance Method Details

#parseObject



5
6
7
8
9
10
11
# File 'lib/goaltender/value_parser/boolean.rb', line 5

def parse
  return false unless input_value.present?
  return true if input_value == "1"
  return true if input_value == true
  return true if input_value == "true"
  return false
end