Sha256: bde14b7b0e6b76516a8ef051871947f05ec78361f1100ad12884185d5c53c2c8

Contents?: true

Size: 463 Bytes

Versions: 19

Compression:

Stored size: 463 Bytes

Contents

module Finitio
  module Syntax
    module Literal
      module Boolean
        include Literal

        TRUE  = "true".freeze
        FALSE = "false".freeze

        def value
          case to_str.strip
          when TRUE  then true
          when FALSE then false
          else
            raise "Unexpected boolean literal `#{to_str}`"
          end
        end

      end # module Boolean
    end # module Literal
  end # module Syntax
end # module Finitio

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
finitio-0.12.0 lib/finitio/syntax/literal/boolean.rb
finitio-0.11.4 lib/finitio/syntax/literal/boolean.rb
finitio-0.11.3 lib/finitio/syntax/literal/boolean.rb
finitio-0.11.2 lib/finitio/syntax/literal/boolean.rb
finitio-0.11.1 lib/finitio/syntax/literal/boolean.rb
finitio-0.10.0 lib/finitio/syntax/literal/boolean.rb
finitio-0.9.1 lib/finitio/syntax/literal/boolean.rb
finitio-0.9.0 lib/finitio/syntax/literal/boolean.rb
finitio-0.8.0 lib/finitio/syntax/literal/boolean.rb
finitio-0.7.0 lib/finitio/syntax/literal/boolean.rb
finitio-0.7.0.pre.rc4 lib/finitio/syntax/literal/boolean.rb
finitio-0.7.0.pre.rc3 lib/finitio/syntax/literal/boolean.rb
finitio-0.7.0.pre.rc2 lib/finitio/syntax/literal/boolean.rb
finitio-0.7.0.pre.rc1 lib/finitio/syntax/literal/boolean.rb
finitio-0.6.1 lib/finitio/syntax/literal/boolean.rb
finitio-0.6.0 lib/finitio/syntax/literal/boolean.rb
finitio-0.5.2 lib/finitio/syntax/literal/boolean.rb
finitio-0.5.1 lib/finitio/syntax/literal/boolean.rb
finitio-0.5.0 lib/finitio/syntax/literal/boolean.rb