Sha256: 1fc1ebaafd8561dea362e769d1135c9e3e9441c3213598ca10b3ea57a778076a

Contents?: true

Size: 475 Bytes

Versions: 12

Compression:

Stored size: 475 Bytes

Contents

require 'xommelier'

class Boolean
  BOOLEAN_MAP = {
    true => true, 'true' => true, 'TRUE' => true, '1' => true, '1.0' => true, 1 => true, 1.0 => true,
    false => false, 'false' => false, 'FALSE' => false, '0' => false, '0.0' => false, 0 => false, 0.0 => false, nil => false, '' => false
  }

  def self.from_xommelier(value)
    BOOLEAN_MAP[value]
  end
end

class TrueClass
  def to_xommelier
    self
  end
end

class FalseClass
  def to_xommelier
    self
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
xommelier-0.1.19 lib/xommelier/core_ext/boolean.rb
xommelier-0.1.18 lib/xommelier/core_ext/boolean.rb
xommelier-0.1.16 lib/xommelier/core_ext/boolean.rb
xommelier-0.1.15 lib/xommelier/core_ext/boolean.rb
xommelier-0.1.14 lib/xommelier/core_ext/boolean.rb
xommelier-0.1.13 lib/xommelier/core_ext/boolean.rb
xommelier-0.1.12 lib/xommelier/core_ext/boolean.rb
xommelier-0.1.11 lib/xommelier/core_ext/boolean.rb
xommelier-0.1.10 lib/xommelier/core_ext/boolean.rb
xommelier-0.1.9 lib/xommelier/core_ext/boolean.rb
xommelier-0.1.8 lib/xommelier/core_ext/boolean.rb
xommelier-0.1.7 lib/xommelier/core_ext/boolean.rb