Method: CommonLib::Array#true_xor_false?
- Defined in:
- lib/common_lib/ruby/array.rb
#true_xor_false? ⇒ Boolean
I need to work on this one …
116 117 118 119 120 121 122 123 124 125 |
# File 'lib/common_lib/ruby/array.rb', line 116 def true_xor_false? # self.include?('true') ^ self.include?('false') ^ # self.include?(true) ^ self.include?(false) contains_true = contains_false = false each {|v| # ( v.to_boolean ) ? contains_true = true : contains_false = true eval("contains_#{v.to_boolean}=true") } contains_true ^ contains_false end |