Sha256: 8823856eda515bc637c5049dc68a09b27437dc1ca8241bf4ec2e8b02635281b7

Contents?: true

Size: 281 Bytes

Versions: 5

Compression:

Stored size: 281 Bytes

Contents

# encoding: utf-8
module WannabeBool
  module Object
    TRUE_VALUES = %W{1 t true on y yes}.freeze

    def to_b
      TRUE_VALUES.include?(self.to_s.strip.downcase)
    end
  end
end

class String
  include WannabeBool::Object
end

class Symbol
  include WannabeBool::Object
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
wannabe_bool-0.1.1 lib/wannabe_bool/object.rb
wannabe_bool-0.1.0 lib/wannabe_bool/object.rb
wannabe_bool-0.0.3 lib/wannabe_bool/object.rb
wannabe_bool-0.0.2 lib/wannabe_bool/object.rb
wannabe_bool-0.0.1 lib/wannabe_bool/object.rb